Skip to content

Commit

Permalink
Merge pull request #6 from EloB/patch-1
Browse files Browse the repository at this point in the history
feat: added support for AMD64
  • Loading branch information
metaskills authored Apr 17, 2024
2 parents e978b95 + 55922bd commit 0c9d489
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/sam-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ echo "== [Custom Ink] installing 'sam-cli' features ... =="

VERSION=${VERSION:-"latest"}

getFile() {
case $1 in
aarch64) echo "aws-sam-cli-linux-arm64.zip" ;;
*) echo "aws-sam-cli-linux-x86_64.zip" ;;
esac
}

FILE=$(getFile $(uname -m))

if [ "${VERSION}" = "latest" ]; then
DOWNLOAD_URL="https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip"
DOWNLOAD_URL="https://github.com/aws/aws-sam-cli/releases/latest/download/${FILE}"
else
DOWNLOAD_URL="https://github.com/aws/aws-sam-cli/releases/download/v${VERSION}/aws-sam-cli-linux-x86_64.zip"
DOWNLOAD_URL="https://github.com/aws/aws-sam-cli/releases/download/v${VERSION}/${FILE}"
fi

sudoIf() {
Expand All @@ -22,7 +31,7 @@ sudoIf() {
cleanup() {
rm -rf \
install \
aws-sam-cli-linux-x86_64.zip \
${FILE} \
aws-sam-cli-src \
dist \
THIRD-PARTY-LICENSES
Expand All @@ -32,8 +41,8 @@ cd /tmp

cleanup

curl -sL "${DOWNLOAD_URL}" > "aws-sam-cli-linux-x86_64.zip"
unzip -qq "aws-sam-cli-linux-x86_64.zip"
curl -sL "${DOWNLOAD_URL}" > $FILE
unzip -qq $FILE
sudoIf ./install --update

cleanup

0 comments on commit 0c9d489

Please sign in to comment.