Skip to content
Myr

Make sure multiple `nvm run` arguments get passed through to node/iojs properly.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #641.

authored by Jordan Harband · committed by Jordan Harband · parent 59e27f8 · Browse files · 3 files+21 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+21 added−3 removed

  • tests:+10 added−1 removed
  • other:+11 added−2 removed

3 files+21 added−3 removed

added:test/slow/nvm run/Running "nvm run --harmony --version" should work+9 added
1#!/bin/sh23die () { echo $@ ; exit 1; }45. ../../../nvm.sh67nvm run 0.10.7 --harmony --version8[ "_$(nvm run 0.10.7 --harmony --version 2>/dev/null | tail -1)" = "_v0.10.7" ] || die "\`nvm run --harmony --version\` failed to run with the correct version"9
modified:test/slow/nvm run/Running "nvm run 0.x" should work+1 added-1 removed
3 unmodified lines
4die () { echo $@ ; exit 1; }56. ../../../nvm.sh78[ "$(nvm run 0.10.7 --version | tail -1)" = "v0.10.7" ] || die "`nvm run` failed to run with the correct version"8[ "$(nvm run 0.10.7 --version | tail -1)" = "v0.10.7" ] || die "\`nvm run\` failed to run with the correct version"9
modified:nvm.sh+11 added-2 removed
1290 unmodified lines
1291 ARGS="$@"1292 local OUTPUT1293 local EXIT_CODE12941295 local ZHS_HAS_SHWORDSPLIT_UNSET1296 ZHS_HAS_SHWORDSPLIT_UNSET=11297 if nvm_has "setopt"; then1298 ZHS_HAS_SHWORDSPLIT_UNSET=$(setopt | command grep shwordsplit > /dev/null ; echo $?)1299 setopt shwordsplit1300 fi1301 if [ "_$VERSION" = "_N/A" ]; then1302 echo "$(nvm_ensure_version_prefix "$provided_version") is not installed yet" >&21303 EXIT_CODE=11304 elif [ "$NVM_IOJS" = true ]; then1305 echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")"1300 OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs "$ARGS")"1306 OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)"1307 EXIT_CODE="$?"1308 else1309 echo "Running node $VERSION"1304 OUTPUT="$(nvm use "$VERSION" >/dev/null && node "$ARGS")"1310 OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)"1311 EXIT_CODE="$?"1312 fi1313 if [ $ZHS_HAS_SHWORDSPLIT_UNSET -eq 1 ] && nvm_has "unsetopt"; then1314 unsetopt shwordsplit1315 fi1316 if [ -n "$OUTPUT" ]; then1317 echo "$OUTPUT"1318 fi1319 return $EXIT_CODE
254 unmodified lines