Skip to content

Commit

Permalink
fix: Exit early if jq is not installed. Fix ssm delete error (#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyen102 committed Mar 16, 2022
1 parent 0b5008b commit 5c9c571
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/environment-delete.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
set -e

# jq is required for this script. Check that 'jq' is installed and exit early if 'jq' is not installed
jq --version > /dev/null
if [[ $? != 0 ]]; then
echo "The package 'jq' is not installed on your system. Please install it. This script will now exit"
exit 1
fi

cd "$(dirname "${BASH_SOURCE[0]}")"
# shellcheck disable=SC1091
[[ $UTIL_SOURCED != yes && -f ./util.sh ]] && source ./util.sh
Expand Down Expand Up @@ -240,7 +247,7 @@ function removeSsmParams() {
for param in "${paramNames[@]}"; do
set +e
printf "\nDeleting param $param"
aws ssm delete-parameter --name $param > /dev/null
aws ssm delete-parameter --region $regionName --name $param > /dev/null
set -e
done

Expand Down

0 comments on commit 5c9c571

Please sign in to comment.