]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adds zsync
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 3 Nov 2016 17:37:10 +0000 (15:37 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 3 Nov 2016 17:37:10 +0000 (15:37 -0200)
zsync [new file with mode: 0755]

diff --git a/zsync b/zsync
new file mode 100755 (executable)
index 0000000..007e548
--- /dev/null
+++ b/zsync
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# ZTD extension to commit, push and fetch a project.
+#
+
+# Parameters
+PROJECT="$1"
+
+# Try to get there
+if [ ! -z "$PROJECT" ]; then
+  cd $PROJECT
+fi
+
+# Sync
+if [ -d '.git' ]; then
+  if which updates 2> /dev/null; then
+    updates
+  else
+    git commit -a -m "Updates $PROJECT"
+    git push
+  fi
+
+  git fetch --all
+fi