Skip to content

Commit

Permalink
Exit with error when missing dependencies are found.
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
molovo committed Jan 4, 2017
1 parent a88ff49 commit 66415b8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion zunit
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,21 @@ function _zunit_run() {
# The main zunit process
###
function _zunit() {
local help version ctx="$1"
local help version ctx="$1" missing_dependencies=0

$(type color >/dev/null 2>&1)
if [[ $? -ne 0 ]]; then
missing_dependencies=$(( missing_dependencies + 1 ))
echo "\033[0;31mMissing required dependency: Color - /~https://github.com/molovo/color\033[0;m"
fi

$(type revolver >/dev/null 2>&1)
if [[ $? -ne 0 ]]; then
missing_dependencies=$(( missing_dependencies + 1 ))
echo "\033[0;31mMissing required dependency: Revolver - /~https://github.com/molovo/revolver\033[0;m"
fi

[[ $missing_dependencies -gt 0 ]] && exit 1

zparseopts -D \
h=help -help=help \
Expand Down

0 comments on commit 66415b8

Please sign in to comment.