Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Commit ec69626

Browse files
chrismckinnelferdingler
authored andcommitted
Fixes issue #74: Check if aws-sam-cli is installed
Instead of attempting to upgrade aws-sam-cli, which will throw an error if it's not installed, check if it's installed first. If it's not installed, install it via brew.
1 parent 0c582fe commit ec69626

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

workshop/static/assets/bootstrap.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ function upgrade_sam_cli() {
3131
# cfn-lint currently clashing with SAM CLI deps
3232
## installing SAM CLI via brew instead
3333
brew tap aws/tap
34-
brew upgrade aws-sam-cli
34+
35+
# upgrade if aws-sam-cli is installed, install if not
36+
set +e
37+
brew ls --versions aws-sam-cli
38+
if [ $? -eq 0 ]; then
39+
brew upgrade aws-sam-cli
40+
else
41+
brew install aws-sam-cli
42+
fi
43+
set -e
3544

3645
_logger "[+] Updating Cloud9 SAM binary"
3746
# Allows for local invoke within IDE (except debug run)

0 commit comments

Comments
 (0)