Skip to content

Commit 9787c43

Browse files
committed
Merge pull request #950 from kui/commands-includes-spaces
[Fix] fix `nvm-exec` for commands including spaces. Relates to #903.
2 parents 91ce41b + b76d43e commit 9787c43

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

nvm-exec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ else
1010
nvm use > /dev/null || (echo "No .nvmrc file found" >&2 && exit 127)
1111
fi
1212

13-
exec $@
13+
exec "$@"

test/slow/nvm exec/Running "nvm exec 0.x" should work

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ die () { echo $@ ; exit 1; }
66

77
nvm use 0.10
88
NPM_VERSION_TEN="$(npm --version)"
9+
TEST_STRING="foo bar"
910

1011
nvm use 0.11.7 && [ "$(node --version)" = "v0.11.7" ] || die "\`nvm use\` failed!"
1112

1213
[ "$(nvm exec 0.10 npm --version | tail -1)" = "$NPM_VERSION_TEN" ] || die "`nvm exec` failed to run with the correct version"
1314

15+
[ "$(nvm exec 0.10 bash -c "printf '$TEST_STRING'" | tail -1)" = "$TEST_STRING" ] || die "`nvm exec` failed to run with the command include white-spaces"

0 commit comments

Comments
 (0)