Skip to content

Commit a64c6ed

Browse files
authored
chore: upgrade mill bootstrap (#523)
1 parent 135a6a5 commit a64c6ed

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

mill

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# - env-variable `MILL_VERSION`
77
# - local file `.mill-version`
88
# - local file `.config/mill-version`
9-
# - `mill-version` from YAML fronmatter of current buildfile
9+
# - `mill-version` from YAML frontmatter of current buildfile
1010
# - if accessible, find the latest stable version available on Maven Central (https://repo1.maven.org/maven2)
1111
# - env-variable `DEFAULT_MILL_VERSION`
1212
#
@@ -23,7 +23,7 @@
2323
# into a cache location (~/.cache/mill/download).
2424
#
2525
# Mill Project URL: https://github.com/com-lihaoyi/mill
26-
# Script Version: 1.0.0-M1-49-ac90e3
26+
# Script Version: 1.0.6
2727
#
2828
# If you want to improve this script, please also contribute your changes back!
2929
# This script was generated from: dist/scripts/src/mill.sh
@@ -33,7 +33,7 @@
3333
set -e
3434

3535
if [ -z "${DEFAULT_MILL_VERSION}" ] ; then
36-
DEFAULT_MILL_VERSION=0.12.14
36+
DEFAULT_MILL_VERSION="1.0.6"
3737
fi
3838

3939

@@ -73,7 +73,19 @@ if [ -z "${MILL_VERSION}" ] ; then
7373
elif [ -f ".config/mill-version" ] ; then
7474
MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)"
7575
elif [ -n "${MILL_BUILD_SCRIPT}" ] ; then
76-
MILL_VERSION="$(cat ${MILL_BUILD_SCRIPT} | grep '//[|] *mill-version: *' | sed 's;//| *mill-version: *;;')"
76+
# `s/.*://`:
77+
# This is a greedy match that removes everything from the beginning of the line up to (and including) the last
78+
# colon (:). This effectively isolates the value part of the declaration.
79+
#
80+
# `s/#.*//`:
81+
# This removes any comments at the end of the line.
82+
#
83+
# `s/['\"]//g`:
84+
# This removes all single and double quotes from the string, wherever they appear (g is for "global").
85+
#
86+
# `s/^[[:space:]]*//; s/[[:space:]]*$//`:
87+
# These two expressions trim any leading or trailing whitespace ([[:space:]] matches spaces and tabs).
88+
MILL_VERSION="$(grep -E "//\|.*mill-version" "${MILL_BUILD_SCRIPT}" | sed -E "s/.*://; s/#.*//; s/['\"]//g; s/^[[:space:]]*//; s/[[:space:]]*$//")"
7789
fi
7890
fi
7991

@@ -309,7 +321,7 @@ if [ -z "$MILL_MAIN_CLI" ] ; then
309321
fi
310322

311323
MILL_FIRST_ARG=""
312-
if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
324+
if [ "$1" = "--bsp" ] || [ "${1#"-i"}" != "$1" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
313325
# Need to preserve the first position of those listed options
314326
MILL_FIRST_ARG=$1
315327
shift

0 commit comments

Comments
 (0)