File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,15 @@ function _check_mgmt() {
3232 echo " Please log in as the mgmt account" >&2
3333 return 1
3434 fi
35+ return 0
3536}
3637
3738function _check_non_mgmt() {
3839 if [[ " $( aws iam list-account-aliases --query ' AccountAliases[0]' --output text) " == ' nhsd-ddc-spine-nrlf-mgmt' ]]; then
3940 echo " Please log in as a non-mgmt account" >&2
4041 return 1
4142 fi
43+ return 0
4244}
4345
4446function _bootstrap() {
@@ -129,7 +131,7 @@ function _bootstrap() {
129131 local workspace
130132 workspace=$2
131133 # Fetch the resources using the AWS CLI command
132- aws resourcegroupstaggingapi get-resources --tag-filters Key=workspace,Values=" $2 " | jq -c ' .ResourceTagMappingList[]' |
134+ aws resourcegroupstaggingapi get-resources --tag-filters Key=workspace,Values=" ${workspace} " | jq -c ' .ResourceTagMappingList[]' |
133135 while IFS= read -r item; do
134136 arn=$( jq -r ' .ResourceARN' <<< " $item" )
135137
@@ -206,6 +208,8 @@ function _bootstrap() {
206208 # ----------------
207209 * ) _bootstrap_help ;;
208210 esac
211+
212+ return 0
209213}
210214
211215_bootstrap " ${@: 1} "
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ function success() {
1010
1111 local message=" $1 "
1212 echo " ✅ ${message} "
13+ return 0
1314}
1415
1516function warning() {
1617 local message=" $1 "
1718 echo -e " ⚠️ \e[31m${message} \e[39m"
19+ return 0
1820}
1921
2022echo
@@ -38,7 +40,7 @@ for dep in ${BUILD_DEPENDENCIES}; do
3840 dep_path=" $( which ${dep} 2> /dev/null) "
3941 set -e
4042
41- if [[ -n " ${dep_path} " -a -x " ${dep_path} " ]]
43+ if [[ -n " ${dep_path} " && -x " ${dep_path} " ]]
4244 then
4345 success " ${dep} found at ${dep_path} "
4446 else
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ function success() {
1313
1414 local message=" $1 "
1515 echo " ✅ ${message} "
16+ return 0
1617}
1718
1819function warning() {
1920 local message=" $1 "
2021 echo -e " ⚠️ \e[31m${message} \e[39m"
22+ return 0
2123}
2224
2325echo
Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ function pull_lambda_code(){
2222 echo -n " - Downloading code for lambda ${lambda_name} .... "
2323 code_url=" $( aws lambda get-function --function-name " ${lambda_name} " | jq -r .Code.Location) "
2424 curl " ${code_url} " 2> /dev/null > " ${DIST_DIR} /${api_name} -${endpoint_name} .zip"
25+
2526 echo " ✅"
27+ return 0
2628}
2729
2830function pull_layer_code(){
@@ -35,7 +37,9 @@ function pull_layer_code(){
3537 echo -n " - Downloading code for layer ${layer_name} version ${layer_version} .... "
3638 code_url=" $( aws lambda get-layer-version --layer-name " ${layer_name} " --version-number " ${layer_version} " | jq -r .Content.Location) "
3739 curl " ${code_url} " 2> /dev/null > " ${DIST_DIR} /${layer_pkg_name} "
40+
3841 echo " ✅"
42+ return 0
3943}
4044
4145mkdir -p " ${DIST_DIR} "
You can’t perform that action at this time.
0 commit comments