Skip to content

Commit 2e6e7e3

Browse files
authored
Enable install command on Windows (#234)
Compare kernel name string in lowercase for consistency. Use bsdtar on Windows for ZIP file extraction.
1 parent abd3002 commit 2e6e7e3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

functions/nvm.fish

+4-2
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,18 @@ function nvm --description "Node version manager"
6969
set --local os (command uname -s | string lower)
7070
set --local ext tar.gz
7171
set --local arch (command uname -m)
72+
set --local tarcmd tar
7273

7374
switch $os
7475
case aix
7576
set arch ppc64
7677
case sunos
7778
case linux
7879
case darwin
79-
case {MSYS_NT,MINGW\*_NT}\*
80+
case {msys_nt,mingw\*_nt}\*
8081
set os win
8182
set ext zip
83+
set tarcmd bsdtar
8284
case \*
8385
echo "nvm: Unsupported operating system: \"$os\"" >&2
8486
return 1
@@ -115,7 +117,7 @@ function nvm --description "Node version manager"
115117
end
116118

117119
if ! command curl -q $silent --progress-bar --location $url |
118-
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
120+
command $tarcmd --extract --gzip --directory $nvm_data/$ver 2>/dev/null
119121
command rm -rf $nvm_data/$ver
120122
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
121123
return 1

0 commit comments

Comments
 (0)