Skip to content

Commit

Permalink
[Fix] declare MANPATH if and only if it's not set
Browse files Browse the repository at this point in the history
By manpath's man page in Ubuntu 16.04:

> If $MANPATH is set, manpath will simply display its contents and issue
> a warning.

By fa22d71 for nvm-sh#1413, `nvm` now will
declare the "MANPATH" variable, no matter if it's set or not, so in the
situation that $MANPATH is set, you'll get the warning:

> manpath: warning: $MANPATH set, ignoring /etc/manpath.config
  • Loading branch information
PeterDaveHello committed Mar 18, 2017
1 parent 2c59f93 commit eccd0a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2661,8 +2661,8 @@ nvm() {
# Prepend current version
PATH="$(nvm_prepend_path "$PATH" "$NVM_VERSION_DIR/bin")"
if nvm_has manpath; then
local MANPATH
if [ -z "$MANPATH" ]; then
local MANPATH
MANPATH=$(manpath)
fi
# Strip other version from MANPATH
Expand Down

0 comments on commit eccd0a8

Please sign in to comment.