Use easily extensible path manipulation

By using a for loop, new entries can easily be added to the PATH without
having to enter additional commands. The precedence of the entries can
also be easily adjusted by reordering the list that is iterated over.
This commit is contained in:
Fernando Schauenburg 2015-11-04 12:52:29 +01:00
parent dc2ee984a1
commit 419775ef10

View file

@ -22,17 +22,18 @@ export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
[ -z "$BACKGROUND" ] && export BACKGROUND="dark" [ -z "$BACKGROUND" ] && export BACKGROUND="dark"
gnubin=/usr/local/opt/coreutils/libexec/gnubin # Prepend custom bin directories to PATH if they exist.
[ -d "$gnubin" ] && PATH="$gnubin:$PATH" for p in /usr/local/opt/coreutils/libexec/gnubin "$HOME/.dotfiles/bin" "$HOME/bin"
[ -d "$HOME/.dotfiles/bin" ] && PATH="$HOME/.dotfiles/bin:$PATH" do
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH" [ -d "$p" ] && export PATH="$p:$PATH"
export PATH done
localman=/usr/local/share/man # Prepend custom man directories to MATPATH if they exist, so that we get
gnuman=/usr/local/opt/coreutils/libexec/gnuman # correct man page entries when multiple versions of a command are available.
[ -d "$localman" ] && MANPATH="$localman:$MANPATH" for p in localman=/usr/local/share/man /usr/local/opt/coreutils/libexec/gnuman
[ -d "$gnuman" ] && MANPATH="$gnuman:$MANPATH" do
export MANPATH [ -d "$p" ] && export MANPATH="$p:$MANPATH"
done
# #
# Aliases # Aliases