Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Handle case of .mill-version with Windows line ends (#65)
Browse files Browse the repository at this point in the history
This is a precaution for cases when the `.mill-version` file can contain
a Windows line end `\r\n` instead of the typical Unix line end `\n`.
Without this fix, in such situation the script breaks in a spectacular
and surprising way.

Pull request: #65
  • Loading branch information
sideeffffect authored Nov 17, 2024
1 parent 7fdbe12 commit fbfbd39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions millw
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ fi
# If not already set, read .mill-version file
if [ -z "${MILL_VERSION}" ] ; then
if [ -f ".mill-version" ] ; then
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
MILL_VERSION="$(tr '\r' '\n' < .mill-version | head -n 1 2> /dev/null)"
elif [ -f ".config/mill-version" ] ; then
MILL_VERSION="$(head -n 1 .config/mill-version 2> /dev/null)"
MILL_VERSION="$(tr '\r' '\n' < .config/mill-version | head -n 1 2> /dev/null)"
fi
fi

Expand Down

0 comments on commit fbfbd39

Please sign in to comment.