Skip to content

Commit

Permalink
fixes minor bug on nvm_alias_command (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioAntunes authored Aug 13, 2020
1 parent 9589622 commit b532e73
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,37 @@ nvm wrapper for fish-shell.

Make sure you have [NVM] installed first.

With [fisher](https://github.com/jorgebucaran/fisher)
### With [fisher]

```fish
fisher add FabioAntunes/fish-nvm
fisher add edc/bass
```

With [oh-my-fish]
### With [oh-my-fish]

```fish
omf install https://github.com/FabioAntunes/fish-nvm
omf install https://github.com/fabioantunes/fish-nvm
omf install https://github.com/edc/bass
```

### With [fundle]

```fish
fundle plugin 'FabioAntunes/fish-nvm'
fundle plugin 'edc/bass'
fundle install
```

Add these lines to `~/.config/fish/config.fish`

```fish
fundle plugin 'FabioAntunes/fish-nvm'
fundle plugin 'edc/bass'
fundle init
```


**fish-nvm** depends on [bass]

## Usage
Expand Down Expand Up @@ -149,7 +167,9 @@ Adding it will cause error: `nvm is not compatible with the npm config "prefix"

[NVM]: https://github.com/creationix/nvm
[brew]: https://brew.sh/
[fisher]: https://github.com/jorgebucaran/fisher
[oh-my-fish]: https://github.com/oh-my-fish/oh-my-fish
[fundle]: https://github.com/danhper/fundle
[bass]: https://github.com/edc/bass

### License
Expand Down
16 changes: 4 additions & 12 deletions functions/nvm_alias_command.fish
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function nvm_alias_command -d "Create an alias command"
return (chmod +x $argv[1])
else
printf "\U274C failed creating %s alias command at %s\n" $argv[2] $argv[1]
printf "Probably a permissions problem, try running sudo fish and then nvm_alias_command\n"
printf "Probably a permissions problem, try running sudo fish, and then nvm_alias_command\n"
end
end
end
Expand All @@ -31,23 +31,15 @@ function nvm_alias_command -d "Create an alias command"

if test $status -ge 1
printf "\U274C failed creating dir $outputPath."
printf "Probably a permissions problem, try running sudo fish and then nvm_alias_command\n"
printf "Probably a permissions problem, try running sudo fish, and then nvm_alias_command\n"
exit 1
end

if test (count $argv) -le 0
set -l path ( dirname (readlink -f (status --current-filename)))
set -l aliases (command ls -1 (realpath $path))
set -l aliases node npm npx yarn

for val in $aliases
if test $val != "nvm.fish";
and test $val != "nvm_alias_command.fish";
and test $val != "nvm_alias_function.fish";
and test $val != "__nvm_run.fish"

set -l alias (string replace .fish '' $val)
for alias in $aliases
__create_alias_command "$outputPath/$alias" $alias
end
end
else
for arg in $argv
Expand Down

0 comments on commit b532e73

Please sign in to comment.