From 607494136878a2115df3b48b0d8454639919bc79 Mon Sep 17 00:00:00 2001 From: Fabio Antunes Date: Thu, 14 Mar 2019 22:45:14 +0000 Subject: [PATCH] fix: node repl issue starting on version 11.10.* --- functions/__nvm_run.fish | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/functions/__nvm_run.fish b/functions/__nvm_run.fish index a4c5274..871bd61 100644 --- a/functions/__nvm_run.fish +++ b/functions/__nvm_run.fish @@ -16,8 +16,15 @@ function __nvm_run end 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) + set count (count $argv) + if test "$count" -ge 2 + set args $argv[2..-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 + eval (string escape -- (type -fP $argv[1])) + end else echo (set_color -o)"Fish nvm:"(set_color normal) "'$argv[1]' is currently not installed, try running npm i -g $argv[1]" return 1