Skip to content

Commit 06cd4c8

Browse files
authored
Fixes recursion (#33)
1 parent 7fe389b commit 06cd4c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

functions/__nvm_run.fish

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ function __nvm_run
77
end
88

99
function run_command
10+
set stack (status stack-trace | grep called | cut -d " " -f 7)
1011
set count (count $argv)
1112
if test "$count" -ge 2
1213
set args $argv[2..-1]
1314
else
1415
set args ""
1516
end
1617

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

0 commit comments

Comments
 (0)