aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsync-code24
l---------[-rwxr-xr-x]sync-home17
2 files changed, 25 insertions, 16 deletions
diff --git a/sync-code b/sync-code
new file mode 100755
index 0000000..bdb5f32
--- /dev/null
+++ b/sync-code
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# sync code or home folder across systems
+#
+
+BASENAME="`basename $0`"
+DEST="$1"
+
+if [ ! -z "$DEST" ]; then
+
+ if [ "$BASENAME" == "sync-code" ]; then
+ profile="$DEST-code"
+ else
+ profile="$DEST-home"
+ fi
+
+ if [ -f "$HOME/.unison/$profile.prf" ]; then
+ unison $profile
+ else
+ echo "No such profile $HOME/.unison/$profile.prf"
+ exit 1
+ fi
+
+fi
diff --git a/sync-home b/sync-home
index 4c9d6db..e737e41 100755..120000
--- a/sync-home
+++ b/sync-home
@@ -1,16 +1 @@
-#!/bin/bash
-#
-# sync home folder across systems
-#
-
-DEST="$1"
-
-if [ ! -z "$DEST" ]; then
- profile="$DEST-home"
- if [ -f "$HOME/.unison/$profile.prf" ]; then
- unison $profile
- else
- echo "No such profile $HOME/.unison/$profile.prf"
- exit 1
- fi
-fi
+sync-code \ No newline at end of file