From: Silvio Rhatto Date: Mon, 20 Feb 2017 17:24:15 +0000 (-0300) Subject: Fixes hydra_set_env for init and register actions X-Git-Tag: 0.2.4~3 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=d55a580084c7130eb3a454ec3be4f51d6e659345;p=hydra.git Fixes hydra_set_env for init and register actions --- diff --git a/lib/hydra/misc b/lib/hydra/misc index 89e0aa0..a3156a7 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -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 }