Skip to content

Commit b879628

Browse files
[Fix] declare MANPATH if and only if it's not set
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 #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
1 parent 9b26293 commit b879628

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nvm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,8 +2661,8 @@ nvm() {
26612661
# Prepend current version
26622662
PATH="$(nvm_prepend_path "$PATH" "$NVM_VERSION_DIR/bin")"
26632663
if nvm_has manpath; then
2664-
local MANPATH
26652664
if [ -z "$MANPATH" ]; then
2665+
local MANPATH
26662666
MANPATH=$(manpath)
26672667
fi
26682668
# Strip other version from MANPATH

0 commit comments

Comments
 (0)