Skip to content

Commit

Permalink
[Fix] zsh: when warncreateglobal is set, this line warns for some…
Browse files Browse the repository at this point in the history
… reason. Use `env` to suppress it.

Fixes #1236.
  • Loading branch information
ljharb committed Sep 18, 2016
1 parent acbdd9a commit d12ccb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1945,10 +1945,10 @@ nvm_die_on_prefix() {
fi

local NVM_NPM_PREFIX
NVM_NPM_PREFIX="$(NPM_CONFIG_LOGLEVEL=warn npm config get prefix)"
NVM_NPM_PREFIX="$(npm config --loglevel=warn get prefix)"
if ! (nvm_tree_contains_path "$NVM_DIR" "$NVM_NPM_PREFIX" >/dev/null 2>&1); then
if [ "_$NVM_DELETE_PREFIX" = "_1" ]; then
NPM_CONFIG_LOGLEVEL=warn npm config delete prefix
npm config --loglevel=warn delete prefix
else
nvm deactivate >/dev/null 2>&1
nvm_err "nvm is not compatible with the npm config \"prefix\" option: currently set to \"$NVM_NPM_PREFIX\""
Expand Down
4 changes: 2 additions & 2 deletions test/fast/Unit tests/nvm_die_on_prefix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ nvm_has() { return 0; }
npm() {
local args
args="$@"
if [ "_$args" = "_config get prefix" ]; then
if [ "_$args" = "_config --loglevel=warn get prefix" ]; then
echo "$(nvm_version_dir new)/good prefix"
fi
}
Expand All @@ -60,7 +60,7 @@ EXIT_CODE="$(NPM_CONFIG_PREFIX=bar nvm_die_on_prefix 0 foo >/dev/null 2>&1; echo
npm() {
local args
args="$@"
if [ "_$args" = "_config get prefix" ]; then
if [ "_$args" = "_config --loglevel=warn get prefix" ]; then
echo "./bad prefix"
fi
}
Expand Down

0 comments on commit d12ccb1

Please sign in to comment.