aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-24 14:00:10 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-24 14:00:10 -0200
commit80acdbc5925e1ecf1d2940a17220197fcad9a38d (patch)
tree113ab211a8fbf56cf0466577c958e4a7a4b1344b
parent082dba6fc6bf38d175a8209a2946eb604e84d803 (diff)
downloadhydra-80acdbc5925e1ecf1d2940a17220197fcad9a38d.tar.gz
hydra-80acdbc5925e1ecf1d2940a17220197fcad9a38d.tar.bz2
Action module-commit should push changes to remote repositories
-rwxr-xr-xshare/hydra/module-commit13
1 files changed, 12 insertions, 1 deletions
diff --git a/share/hydra/module-commit b/share/hydra/module-commit
index 131b7db..4831869 100755
--- a/share/hydra/module-commit
+++ b/share/hydra/module-commit
@@ -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