Shorten unnecessarily long parts

This commit is contained in:
Fernando Schauenburg 2019-11-11 11:37:11 +01:00
parent d5245eab46
commit b8c257ff9b

View file

@ -26,18 +26,11 @@ export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
# Prevent path_helper from messing with the PATH when starting tmux. # Prevent path_helper from messing with the PATH when starting tmux.
# See: https://superuser.com/a/583502 # See: https://superuser.com/a/583502
if [ "$(uname)" == "Darwin" ]; then [ "$(uname)" == "Darwin" ] && { PATH=""; source /etc/profile; }
# shellcheck disable=SC2123 # intentionally clearing the PATH here
PATH=""
# shellcheck disable=SC1091 # /etc/profile is part of macOS
source /etc/profile
fi
# Add custom bin dirs to PATH if they exist and are not already in PATH. # Add custom bin dirs to PATH if they exist and are not already in PATH.
while read -r bindir; do while read -r dir; do
if [ -d "$bindir" ] && [[ ":$PATH:" != *":$bindir:"* ]]; then [ -d "$dir" ] && [[ ":$PATH:" != *":$dir:"* ]] && PATH="$dir:$PATH"
PATH="$bindir:$PATH"
fi
done <<EOS done <<EOS
$LOCAL_PREFIX/bin $LOCAL_PREFIX/bin
$LOCAL_PREFIX/opt/man-db/libexec/bin $LOCAL_PREFIX/opt/man-db/libexec/bin
@ -52,10 +45,8 @@ EOS
# available. # available.
export MANPATH export MANPATH
MANPATH=$(MANPATH='' manpath) MANPATH=$(MANPATH='' manpath)
while read -r mandir; do while read -r dir; do
if [ -d "$mandir" ] && [[ ":$MANPATH:" != *":$mandir:"* ]]; then [ -d "$dir" ] && [[ ":$MANPATH:" != *":$dir:"* ]] && MANPATH="$dir:$MANPATH"
MANPATH="$mandir:$MANPATH"
fi
done <<EOS done <<EOS
$LOCAL_PREFIX/share/man $LOCAL_PREFIX/share/man
$LOCAL_PREFIX/opt/man-db/libexec/man $LOCAL_PREFIX/opt/man-db/libexec/man
@ -64,7 +55,7 @@ done <<EOS
$HOME/.local/share/man $HOME/.local/share/man
EOS EOS
unset bindir mandir unset dir
############################################################################## ##############################################################################
# Customize shell options & variables # Customize shell options & variables