setup: Add blank file check to check_command
This way we can better gaurd against empty files as seen in the previous commits message. Signed-off-by: Manuel Mendez <mmendez@equinix.com>
This commit is contained in:
parent
549e540671
commit
ffbb92909b
12
setup.sh
12
setup.sh
@ -427,13 +427,15 @@ command_exists() (
|
||||
)
|
||||
|
||||
check_command() (
|
||||
if command_exists "$1"; then
|
||||
echo "$BLANK Found prerequisite: $1"
|
||||
return 0
|
||||
else
|
||||
echo "$ERR Prerequisite command not installed: $1"
|
||||
if ! command_exists "$1"; then
|
||||
echo "$ERR Prerequisite executable command not found: $1"
|
||||
return 1
|
||||
fi
|
||||
if ! [[ -s "$(which "$1")" ]]; then
|
||||
echo "$ERR Prerequisite command is an empty file: $1"
|
||||
fi
|
||||
echo "$BLANK Found prerequisite: $1"
|
||||
return 0
|
||||
)
|
||||
|
||||
check_prerequisites() (
|
||||
|
Loading…
Reference in New Issue
Block a user