diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hydra/misc | 15 |
1 files changed, 10 insertions, 5 deletions
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 } |