When no arguments are passed to `nvm run X`, use `nvm exec` to open a REPL.
Fixes #625. Tests will be in #717.master
parent
c966204cd6
commit
d68f667464
7
nvm.sh
7
nvm.sh
|
@ -1451,6 +1451,13 @@ nvm() {
|
||||||
if [ "_$VERSION" = "_N/A" ]; then
|
if [ "_$VERSION" = "_N/A" ]; then
|
||||||
echo "$(nvm_ensure_version_prefix "$provided_version") is not installed yet" >&2
|
echo "$(nvm_ensure_version_prefix "$provided_version") is not installed yet" >&2
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
|
elif [ -z "$ARGS" ]; then
|
||||||
|
if [ "$NVM_IOJS" = true ]; then
|
||||||
|
nvm exec "$VERSION" iojs
|
||||||
|
else
|
||||||
|
nvm exec "$VERSION" node
|
||||||
|
fi
|
||||||
|
EXIT_CODE="$?"
|
||||||
elif [ "$NVM_IOJS" = true ]; then
|
elif [ "$NVM_IOJS" = true ]; then
|
||||||
echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")"
|
echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")"
|
||||||
OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)"
|
OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)"
|
||||||
|
|
Loading…
Reference in New Issue