summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-03-28 12:28:13 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-03-28 12:28:13 -0300
commit84049560f09647b70ff6d860de2956d73fd3480e (patch)
tree8a3d5ca01b27be873aefe9bbbe1954fb3587e004
parentec51dff6b70cf8ca6b72d1bf24288d3d1b595d32 (diff)
downloadhydra-84049560f09647b70ff6d860de2956d73fd3480e.tar.gz
hydra-84049560f09647b70ff6d860de2956d73fd3480e.tar.bz2
Check if hydra is configured
-rw-r--r--lib/hydra/misc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index d8dfb3b..8071c32 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -15,6 +15,13 @@ function hydra_set_env {
export HYDRA_FOLDER="`hydra_eval_parameter $HYDRA`"
export PREFERENCES="$HOME/.hydra/$HYDRA"
fi
+
+ if [ "$ACTION" != "register" ] && [ "$ACTION" != "init" ]; then
+ if [ -z "$HYDRA_FOLDER" ] || [ ! -d "$HYDRA_FOLDER" ]; then
+ echo "hydra $HYDRA not configured, aborting"
+ exit 1
+ fi
+ fi
}
# Read a parameter from user