Skip to content

Commit

Permalink
bump mill to 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Jul 8, 2019
1 parent 20d3e6a commit 210c2ce
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.4.2
DEFAULT_MILL_VERSION=0.5.0

set -e

if [ -z "$MILL_VERSION" ] ; then
MILL_VERSION=$DEFAULT_MILL_VERSION
if [ -f ".mill-version" ] ; then
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
else
MILL_VERSION=$DEFAULT_MILL_VERSION
fi
fi

MILL_DOWNLOAD_PATH="$HOME/.mill/download"
Expand All @@ -17,10 +23,9 @@ MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
if [ ! -x "$MILL_EXEC_PATH" ] ; then
mkdir -p $MILL_DOWNLOAD_PATH
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION"
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
chmod +x "$DOWNLOAD_FILE"
mkdir -p "$MILL_DOWNLOAD_PATH"
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
unset DOWNLOAD_FILE
unset MILL_DOWNLOAD_URL
Expand All @@ -29,4 +34,4 @@ fi
unset MILL_DOWNLOAD_PATH
unset MILL_VERSION

exec $MILL_EXEC_PATH "$@"
exec $MILL_EXEC_PATH "$@"

0 comments on commit 210c2ce

Please sign in to comment.