Skip to content

Commit

Permalink
Fixes recursion (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioAntunes committed Feb 27, 2019
1 parent 7fe389b commit 06cd4c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/__nvm_run.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ function __nvm_run
end

function run_command
set stack (status stack-trace | grep called | cut -d " " -f 7)
set count (count $argv)
if test "$count" -ge 2
set args $argv[2..-1]
else
set args ""
end

if type -fqP $argv[1]
if type -fqP $argv[1]; and test "$stack[1]" != (which $argv[1])
# https://stackoverflow.com/questions/45237675/proxying-arguments-from-one-function-to-a-command/45238056#45238056
eval (string escape -- (type -fP $argv[1]) $args)
else
Expand Down

0 comments on commit 06cd4c8

Please sign in to comment.