Move checking aws cli to separate function

This commit is contained in:
Miłosz Smółka 2019-02-07 09:30:47 +01:00
parent 1ee4517370
commit 34beaaabe4
3 changed files with 11 additions and 7 deletions

View File

@ -5,6 +5,7 @@
# be sure any test cases set this.
load test_helper
verify_aws_cli
fixtures provisioner-file
setup() {

View File

@ -5,6 +5,7 @@
# be sure any test cases set this.
load test_helper
verify_aws_cli
fixtures provisioner-shell
setup() {

View File

@ -1,11 +1,13 @@
# Let's verify that the tools we need are installed
declare -a required=(aws)
for cmd in "${required[@]}"; do
command -v $cmd >/dev/null 2>&1 || {
echo "'$cmd' must be installed" >&2
exit 1
}
done
verify_aws_cli() {
declare -a required=(aws)
for cmd in "${required[@]}"; do
command -v $cmd >/dev/null 2>&1 || {
echo "'$cmd' must be installed" >&2
exit 1
}
done
}
#--------------------------------------------------------------------
# Bats modification