]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fixes hydra_set_env for init and register actions
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 20 Feb 2017 17:24:15 +0000 (14:24 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 20 Feb 2017 17:24:15 +0000 (14:24 -0300)
lib/hydra/misc

index 89e0aa019cd07db341b9dc8863d91a68eb129b7a..a3156a71367109919ebffcd077a0973de8596150 100644 (file)
@@ -6,7 +6,10 @@ function hydra_set_env {
   export OSVERSION="`cut -d . -f 1 /etc/debian_version`"
   export COMMIT="`( cd $APP_BASE && git log -n 1 --pretty=oneline 2> /dev/null | cut -d " " -f 1 )`"
   export CONFIG="$HOME/.hydra/config"
-  export ACTION="$1"
+
+  if [ -z "$ACTION" ]; then
+    export ACTION="$1"
+  fi
 
   if [ "`whoami`" != 'root' ]; then
     SUDO="sudo"
@@ -17,10 +20,12 @@ function hydra_set_env {
     export PREFERENCES="$HOME/.hydra/$HYDRA"
   fi
 
-  if [ "$NAME" == "hydra" ] && [ "$ACTION" != "register" ] && [ "$ACTION" != "init" ]; then
-    if [ -z "$HYDRA_FOLDER" ] || [ ! -d "$HYDRA_FOLDER" ]; then
-      echo "hydra $HYDRA not configured, aborting"
-      exit 1
+  if [ "$NAME" == "hydra" ]; then
+    if [ "$ACTION" != "register" ] && [ "$ACTION" != "init" ]; then
+      if [ -z "$HYDRA_FOLDER" ] || [ ! -d "$HYDRA_FOLDER" ]; then
+        echo "hydra $HYDRA not configured, aborting"
+        exit 1
+      fi
     fi
   fi
 }