[New] `use`: set `NVM_INC` to expose the node include path

Bruce A. MacNaughton 2020-02-07 06:23:35 -08:00 committed by Jordan Harband
parent f4eddb2c9c
commit 6c560b12b6
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 3 additions and 1 deletions

4
nvm.sh
View File

@ -2896,6 +2896,7 @@ nvm() {
fi
fi
unset NVM_BIN
unset NVM_INC
;;
"use")
local PROVIDED_VERSION
@ -2993,6 +2994,7 @@ nvm() {
export PATH
hash -r
export NVM_BIN="${NVM_VERSION_DIR}/bin"
export NVM_INC="${NVM_VERSION_DIR}/include/node"
if [ "${NVM_SYMLINK_CURRENT-}" = true ]; then
command rm -f "${NVM_DIR}/current" && ln -s "${NVM_VERSION_DIR}" "${NVM_DIR}/current"
fi
@ -3542,7 +3544,7 @@ nvm() {
nvm_curl_libz_support nvm_command_info nvm_is_zsh nvm_stdout_is_terminal \
>/dev/null 2>&1
unset NVM_RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_IOJS_ORG_MIRROR NVM_DIR \
NVM_CD_FLAGS NVM_BIN NVM_MAKE_JOBS \
NVM_CD_FLAGS NVM_BIN NVM_INC NVM_MAKE_JOBS \
>/dev/null 2>&1
;;
*)