Skip to content

Commit

Permalink
fix(install.sh): support windows mingw platform (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed May 24, 2024
1 parent 990f3d0 commit 463cc90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set -e
RELEASE="latest"
OS="$(uname -s)"

case "${OS}" in
MINGW* | Win*) OS="Windows" ;;
esac

if [ -d "$HOME/.fnm" ]; then
INSTALL_DIR="$HOME/.fnm"
elif [ -n "$XDG_DATA_HOME" ]; then
Expand Down Expand Up @@ -70,6 +74,9 @@ set_filename() {
elif [ "$OS" = "Darwin" ]; then
USE_HOMEBREW="true"
echo "Downloading fnm using Homebrew..."
elif [ "$OS" = "Windows" ] ; then
FILENAME="fnm-windows"
echo "Downloading the latest fnm binary from GitHub..."
else
echo "OS $OS is not supported."
echo "If you think that's a bug - please file an issue to https://github.com/Schniz/fnm/issues"
Expand Down Expand Up @@ -180,6 +187,7 @@ setup_shell() {
echo ' set PATH "'"$INSTALL_DIR"'" $PATH'
echo ' fnm env | source'

echo '' >>$CONF_FILE
echo '# fnm' >>$CONF_FILE
echo 'set PATH "'"$INSTALL_DIR"'" $PATH' >>$CONF_FILE
echo 'fnm env | source' >>$CONF_FILE
Expand Down

0 comments on commit 463cc90

Please sign in to comment.