]> gitweb.fluxo.info Git - hydra.git/commitdiff
Simplifying module-commit
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 15:40:37 +0000 (13:40 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 15:40:37 +0000 (13:40 -0200)
share/hydra/module-commit

index a4ede8c68e55fb9e405173f6c50b1a2809bea961..db8e9350090e05f8959e92730cb9e4db62c9740c 100755 (executable)
@@ -22,16 +22,11 @@ hydra_config_load
 
 MODULE="$1"
 
-if hydra_is_git; then
-  if pwd | grep -q "/$MODULE/"; then
-    shift
-    git commit -a -m "$*"
-    hydra $HYDRA module-update $MODULE
-  else
-    echo "Not inside module $MODULE"
-    exit 1
-  fi
+if [ -d "$HYDRA_FOLDER/modules/$MODULE" ]; then
+  shift
+  ( cd "$HYDRA_FOLDER/modules/$MODULE" && git commit -a -m "$*" )
+  hydra $HYDRA module-update $MODULE
 else
-  echo "Not a git repository"
+  echo "Not such module $MODULE"
   exit 1
 fi