]> gitweb.fluxo.info Git - hydra.git/commitdiff
Action module-commit should push changes to remote repositories
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 16:00:10 +0000 (14:00 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 16:00:10 +0000 (14:00 -0200)
share/hydra/module-commit

index 131b7db9fc5ce0d545f2b4f043979bb9bb2e1ff3..483186918226700ce851d890138ac02b10e0e2ab 100755 (executable)
@@ -22,10 +22,21 @@ hydra_config_load
 
 MODULE="$1"
 
+# Push to repositories
+function hydra_git_push {
+  if [ "`git remote | wc -l`" == "0" ]; then
+    return
+  elif git remote | grep -q 'all'; then
+    git push all --all
+  elif git remote | grep -q 'origin'; then
+    git push --all
+  fi
+}
+
 if [ -d "$HYDRA_FOLDER/modules/$MODULE" ]; then
   shift
   echo "Commiting changes at $MODULE module..."
-  ( cd "$HYDRA_FOLDER/modules/$MODULE" && git commit -a -m "$*" )
+  ( cd "$HYDRA_FOLDER/modules/$MODULE" && git commit -a -m "$*" && hydra_git_push )
   echo ""
   hydra $HYDRA module-update $MODULE
 else