Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active April 2, 2023 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dacr/2e8867c95b222d226df556e49984f083 to your computer and use it in GitHub Desktop.
Save dacr/2e8867c95b222d226df556e49984f083 to your computer and use it in GitHub Desktop.
Very simple ammonite upgrade script with multiple scala release taken into account / published by https://github.com/dacr/code-examples-manager #cccf287a-2a4d-45e7-9b93-b8816537bc58/2c5c1bc8b40231cd52b4a1478336b18d232c1e15
#!/usr/bin/env bash
## summary : Very simple ammonite upgrade script with multiple scala release taken into account
## keywords : bash, ammonite, update, scala
## publish : gist
## authors : David Crosson
## license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
## id : cccf287a-2a4d-45e7-9b93-b8816537bc58
## created-on : 2020-05-27T14:29:46+02:00
## managed-by : https://github.com/dacr/code-examples-manager
REL=$1
if [ "$REL" = "" ]; then
echo "please provide amm release such as 2.4.0"
exit 0
fi
AMM3=amm-3.0-$REL
AMM13=amm-2.13-$REL
AMM12=amm-2.12-$REL
if [ ! -f $AMM3 ] ; then
sh -c "(echo '#!/usr/bin/env sh' && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/$REL/3.0-$REL)" > $AMM3
#curl -L https://github.com/lihaoyi/Ammonite/releases/download/$REL/3.0-$REL -o $AMM3
chmod a+rx $AMM3
fi
if [ ! -f $AMM13 ] ; then
sh -c "(echo '#!/usr/bin/env sh' && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/$REL/2.13-$REL)" > $AMM13
#curl -L https://github.com/lihaoyi/Ammonite/releases/download/$REL/2.13-$REL -o $AMM13
chmod a+rx $AMM13
fi
if [ ! -f $AMM12 ] ; then
sh -c "(echo '#!/usr/bin/env sh' && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/$REL/2.12-$REL)" > $AMM12
#curl -L https://github.com/lihaoyi/Ammonite/releases/download/$REL/2.12-$REL -o $AMM12
chmod a+rx $AMM12
fi
rm -f amm amm-2.12 amm-2.13 amm-3.0
ln -s $AMM13 amm-2.13
ln -s $AMM12 amm-2.12
ln -s $AMM3 amm-3.0
ln -s amm-3.0 amm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment