From d55a580084c7130eb3a454ec3be4f51d6e659345 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 20 Feb 2017 14:24:15 -0300 Subject: Fixes hydra_set_env for init and register actions --- lib/hydra/misc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib') 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 } -- cgit v1.2.3