mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-12 07:01:50 +00:00
Add a test for MANPATH
This commit is contained in:
parent
605dd1092f
commit
c2d4844b31
14
test/fast/Sourcing nvm.sh should set MANPATH correctly.
Executable file
14
test/fast/Sourcing nvm.sh should set MANPATH correctly.
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
mkdir -p ../../v0.10.26/share/man
|
||||||
|
echo v0.10.26 >../../alias/default
|
||||||
|
|
||||||
|
T_NVM_DIR=$(pwd)
|
||||||
|
T_NVM_DIR=${T_NVM_DIR%/test/fast}
|
||||||
|
|
||||||
|
T_MANPATH=`manpath`
|
||||||
|
T_MANPATH=`echo ${T_MANPATH} | awk -v RS=: -v ORS=: "/${T_NVM_DIR//\//\\/}/ "'{next} {print}' | sed 's/:*$//'`
|
||||||
|
|
||||||
|
. ../../nvm.sh
|
||||||
|
|
||||||
|
#The nvm entry should be the first one of MANPATH and remain other entries exist.
|
||||||
|
[ `expr "$MANPATH" : ".*$NVM_DIR/.*/share/man"` != 0 ] && [ "${MANPATH#*$NVM_DIR/*/man:}" = "${T_MANPATH}" ]
|
Loading…
Reference in New Issue
Block a user