summaryrefslogtreecommitdiff
path: root/mill
diff options
context:
space:
mode:
authorNathaniel Fischer <nfischer921@gmail.com>2019-09-05 12:00:36 -0700
committerTobias Roeser <le.petit.fou@web.de>2019-09-05 21:00:36 +0200
commit9a5fcfdee992884f22b9135790b0eac617740b4b (patch)
treee40ff8e0a903b28214ad67c0971535a4b44666ac /mill
parent826deadfe5dfbbf9461df0b1d2efd3cc38f7021d (diff)
downloadmill-9a5fcfdee992884f22b9135790b0eac617740b4b.tar.gz
mill-9a5fcfdee992884f22b9135790b0eac617740b4b.tar.bz2
mill-9a5fcfdee992884f22b9135790b0eac617740b4b.zip
Make mill wrapper backwards compatible (#670)
* Make mill wrapper backwards compatible resolves https://github.com/lihaoyi/mill/issues/669 * more intelligent version comparison
Diffstat (limited to 'mill')
-rwxr-xr-xmill9
1 files changed, 8 insertions, 1 deletions
diff --git a/mill b/mill
index e9690032..edba1475 100755
--- a/mill
+++ b/mill
@@ -20,10 +20,17 @@ fi
MILL_DOWNLOAD_PATH="$HOME/.mill/download"
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
+version_remainder="$MILL_VERSION"
+MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
+MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
+
if [ ! -x "$MILL_EXEC_PATH" ] ; then
mkdir -p $MILL_DOWNLOAD_PATH
+ if [ $MILL_MAJOR_VERSION -gt 0 ] || [ $MILL_MINOR_VERSION -ge 5 ] ; then
+ ASSEMBLY="-assembly"
+ fi
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
- MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
+ 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"
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"