mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
* set path based on contents of a PATHRC file defaulting to .pathrc
PATHRC file should have one directory per line to set the path
* set manpath based on contents of a MANPATHRC file defaulting to .manpathrc
MANPATHRC file should have one directory per line to set the manpath
27 lines
516 B
Bash
27 lines
516 B
Bash
# If there is no PATHRC already set, default to ~/.pathrc
|
|
if [ -z "$PATHRC" ]; then
|
|
PATHRC=$HOME/.pathrc
|
|
fi
|
|
|
|
# Similarly, MANPATHRC defaults to ~/.manpath
|
|
if [ -z "$MANPATHRC" ]; then
|
|
MANPATHRC=$HOME/.manpathrc
|
|
fi
|
|
|
|
# Set the PATH
|
|
if [ -f $PATHRC ]; then
|
|
path=()
|
|
typeset -U path
|
|
for dir in $(<$PATHRC); do
|
|
path+=($dir)
|
|
done
|
|
fi
|
|
|
|
# Set the MANPATH
|
|
if [ -f $MANPATHRC ]; then
|
|
manpath=()
|
|
typeset -U manpath
|
|
for dir in $(<$MANPATHRC); do
|
|
manpath+=($dir)
|
|
done
|
|
fi
|