Fix nvm_ensure_version_installed iojs to not print an empty string for the version.

This commit is contained in:
Jordan Harband
2015-09-11 10:42:47 +09:00
parent 014a44e154
commit e3528b0d9e
2 changed files with 10 additions and 1 deletions

4
nvm.sh
View File

@@ -210,7 +210,9 @@ nvm_ensure_version_installed() {
if [ $? -eq 0 ]; then
echo "N/A: version \"$PROVIDED_VERSION -> $VERSION\" is not yet installed" >&2
else
echo "N/A: version \"$(nvm_ensure_version_prefix "$PROVIDED_VERSION")\" is not yet installed" >&2
local PREFIXED_VERSION
PREFIXED_VERSION="$(nvm_ensure_version_prefix "$PROVIDED_VERSION")"
echo "N/A: version \"${PREFIXED_VERSION:-$PROVIDED_VERSION}\" is not yet installed" >&2
fi
return 1
fi