]> gitweb.fluxo.info Git - scripts.git/commitdiff
Making sync-home also sync-code
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Feb 2013 20:54:24 +0000 (18:54 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Feb 2013 20:54:24 +0000 (18:54 -0200)
sync-code [new file with mode: 0755]
sync-home [changed from file to symlink]

diff --git a/sync-code b/sync-code
new file mode 100755 (executable)
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
deleted file mode 100755 (executable)
index 4c9d6dbb094923b17c07380ab98de04d5358b124..0000000000000000000000000000000000000000
--- a/sync-home
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/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
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..e737e417a396eca22656e2035e6145aa42447ec0
--- /dev/null
+++ b/sync-home
@@ -0,0 +1 @@
+sync-code
\ No newline at end of file