Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable install command on Windows #234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions functions/nvm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ function nvm --description "Node version manager"
set --local os (command uname -s | string lower)
set --local ext tar.gz
set --local arch (command uname -m)
set --local tarcmd tar

switch $os
case aix
set arch ppc64
case sunos
case linux
case darwin
case {MSYS_NT,MINGW\*_NT}\*
case {msys_nt,mingw\*_nt}\*
set os win
set ext zip
set tarcmd bsdtar
case \*
echo "nvm: Unsupported operating system: \"$os\"" >&2
return 1
Expand Down Expand Up @@ -114,7 +116,7 @@ function nvm --description "Node version manager"
end

if ! command curl -q $silent --progress-bar --location $url |
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
command $tarcmd --extract --gzip --directory $nvm_data/$ver 2>/dev/null
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to remember which version of Fish started supporting this way of running a command?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you asking about the command builtin or using variable expansion for the program name? I believe both have been present since the first release of Fish.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgebucaran Is there anything else needed before you can merge this PR?

command rm -rf $nvm_data/$ver
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
return 1
Expand Down