diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2019-06-29 22:28:16 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2019-06-30 02:54:39 -0700 |
commit | 4896f5150ff0f7386a573b7191cfb652ed42a047 (patch) | |
tree | 3611d90bfb0e918c0c5e10f3dc1eab11fe09d07c /mill | |
parent | 29fc3b6c8f74ece3b6e6cf354f0e342bbf8511ac (diff) | |
download | cask-4896f5150ff0f7386a573b7191cfb652ed42a047.tar.gz cask-4896f5150ff0f7386a573b7191cfb652ed42a047.tar.bz2 cask-4896f5150ff0f7386a573b7191cfb652ed42a047.zip |
upgrade Mill to latest version
Diffstat (limited to 'mill')
-rwxr-xr-x | mill | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +# 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 + +set -e + +if [ -z "$MILL_VERSION" ] ; then + MILL_VERSION=$DEFAULT_MILL_VERSION +fi + +MILL_DOWNLOAD_PATH="$HOME/.mill/download" +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" + curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL" + chmod +x "$DOWNLOAD_FILE" + mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH" + unset DOWNLOAD_FILE + unset MILL_DOWNLOAD_URL +fi + +unset MILL_DOWNLOAD_PATH +unset MILL_VERSION + +exec $MILL_EXEC_PATH "$@" |