Skip to content

Commit

Permalink
Support ARM64 architecture to the launcher script for Mac OS (#2895)
Browse files Browse the repository at this point in the history
* Support arm64 arch for Mac on launcher script

* Deduplicate variable
  • Loading branch information
carlosedp authored May 9, 2024
1 parent 2288e46 commit 8ffaa75
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scala-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" == "Linux" ]; then
fi
CACHE_BASE="$HOME/.cache/coursier/v1"
elif [ "$(uname)" == "Darwin" ]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-x86_64-apple-darwin.gz"
arch=$(uname -m)
CACHE_BASE="$HOME/Library/Caches/Coursier/v1"
if [[ "$arch" == "x86_64" ]]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-x86_64-apple-darwin.gz"
elif [[ "$arch" == "arm64" ]]; then
SCALA_CLI_URL="https://github.com/$GH_ORG/$GH_NAME/releases/download/$TAG/scala-cli-aarch64-apple-darwin.gz"
else
echoerr "scala-cli is not supported on $arch"
exit 2
fi
else
echo "This standalone scala-cli launcher is supported only in Linux and macOS. If you are using Windows, please use the dedicated launcher scala-cli.bat"
exit 1
echo "This standalone scala-cli launcher is supported only in Linux and macOS. If you are using Windows, please use the dedicated launcher scala-cli.bat"
exit 1
fi

CACHE_DEST="$CACHE_BASE/$(echo "$SCALA_CLI_URL" | sed 's@://@/@')"
Expand Down

0 comments on commit 8ffaa75

Please sign in to comment.