-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env sh | ||
|
||
# This is a wrapper script, that automatically download ammonite from GitHub release pages | ||
# You can give the required mill version with AMM_VERSION env variable | ||
# If no version is given, it falls back to the value of DEFAULT_AMM_VERSION | ||
DEFAULT_AMM_VERSION= | ||
|
||
set -e | ||
|
||
if [ -z "$AMM_VERSION" ] ; then | ||
AMM_VERSION=$DEFAULT_AMM_VERSION | ||
fi | ||
|
||
AMM_DOWNLOAD_PATH="$HOME/.ammonite/download" | ||
AMM_EXEC_PATH="${AMM_DOWNLOAD_PATH}/$AMM_VERSION" | ||
|
||
if [ ! -x "$AMM_EXEC_PATH" ] ; then | ||
mkdir -p $AMM_DOWNLOAD_PATH | ||
DOWNLOAD_FILE=$AMM_EXEC_PATH-tmp-download | ||
AMM_DOWNLOAD_URL="https://github.com/lihaoyi/ammonite/releases/download/${AMM_VERSION%%-*}/2.13-$AMM_VERSION" | ||
curl --fail -L -o "$DOWNLOAD_FILE" "$AMM_DOWNLOAD_URL" | ||
chmod +x "$DOWNLOAD_FILE" | ||
mv "$DOWNLOAD_FILE" "$AMM_EXEC_PATH" | ||
unset DOWNLOAD_FILE | ||
unset AMM_DOWNLOAD_URL | ||
fi | ||
|
||
unset AMM_DOWNLOAD_PATH | ||
unset AMM_VERSION | ||
|
||
exec $AMM_EXEC_PATH "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters