From f591265ee8e1227dbc8d0e781594f7ea048f4145 Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 1 Jun 2020 16:21:43 -0500 Subject: [PATCH] .profile: Polish up our path patching --- .profile | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.profile b/.profile index f15348f1..6ff7cc02 100755 --- a/.profile +++ b/.profile @@ -6,7 +6,7 @@ ## POSIX NOTICE # This script, or at least the parts expected to be run by a standard sh # implementation, should be fully POSIX-compliant. If it is not, open a bug -# report at gitlab.com/rehashedsalt/home and I'll take care of it. +# report at git.9iron.club/salt/home and I'll take care of it. ## SHELLCHECK # Not finding these sources is none of my concern; they're out of scope @@ -25,23 +25,20 @@ _baseshell="$(basename -- "$0")" # Patch PATH -desiredpath="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/games:/usr/games" -for dir in "$HOME/.bin" "$HOME/.local/bin"; do - if [ -d "$dir" ] && [ -O "$dir" ]; then - desiredpath="$desiredpath:$dir" - fi -done -IFS=":" -for path in $desiredpath; do - PATH="${PATH#*$path}" -done -unset IFS -while [ "${PATH#:}" != "$PATH" ]; do - PATH="${PATH#:}" -done -PATH="$desiredpath:$PATH" -# Homebrew +unset PATH for dir in \ + "$HOME/.bin" \ + "$HOME/.local/bin" \ + "$HOME/.firestarter" \ + "/usr/games" \ + "/usr/local/games" \ + "/snap/bin" \ + "/sbin" \ + "/bin" \ + "/usr/sbin" \ + "/usr/bin" \ + "/usr/local/sbin" \ + "/usr/local/bin" \ "/usr/local/opt/coreutils/libexec/gnubin" \ "/usr/local/opt/gnu-sed/libexec/gnubin" \ "/usr/local/opt/grep/libexec/gnubin" \