Add undocumented `nvm debug` to print out helpful debugging info.

master
Jordan Harband 2015-05-14 14:56:26 -07:00
parent 2dec01da9c
commit 5e805905ca
1 changed files with 11 additions and 0 deletions

11
nvm.sh
View File

@ -1141,6 +1141,17 @@ nvm() {
echo
;;
"debug" )
echo >&2 "\$SHELL: $SHELL"
echo >&2 "\$NVM_DIR: $(echo $NVM_DIR | sed "s#$HOME#\$HOME#g")"
for NVM_DEBUG_COMMAND in 'nvm current' 'which node' 'which iojs' 'which npm' 'npm config get prefix' 'npm root -g'
do
local NVM_DEBUG_OUTPUT="$($NVM_DEBUG_COMMAND | sed "s#$NVM_DIR#\$NVM_DIR#g")"
echo >&2 "$NVM_DEBUG_COMMAND: ${NVM_DEBUG_OUTPUT}"
done
return 42
;;
"install" | "i" )
local nobinary
local version_not_provided