From b8c257ff9b59b10e31c367772c176888d051798c Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Mon, 11 Nov 2019 11:37:11 +0100 Subject: [PATCH] Shorten unnecessarily long parts --- dotfiles/.config/bash/profile | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dotfiles/.config/bash/profile b/dotfiles/.config/bash/profile index a4e65b7..c203f37 100644 --- a/dotfiles/.config/bash/profile +++ b/dotfiles/.config/bash/profile @@ -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. # See: https://superuser.com/a/583502 -if [ "$(uname)" == "Darwin" ]; then - # shellcheck disable=SC2123 # intentionally clearing the PATH here - PATH="" - # shellcheck disable=SC1091 # /etc/profile is part of macOS - source /etc/profile -fi +[ "$(uname)" == "Darwin" ] && { PATH=""; source /etc/profile; } # Add custom bin dirs to PATH if they exist and are not already in PATH. -while read -r bindir; do - if [ -d "$bindir" ] && [[ ":$PATH:" != *":$bindir:"* ]]; then - PATH="$bindir:$PATH" - fi +while read -r dir; do + [ -d "$dir" ] && [[ ":$PATH:" != *":$dir:"* ]] && PATH="$dir:$PATH" done <