From 6e01d0308eab27b9b59b49888fd9e135bc98620c Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sat, 22 Aug 2026 01:59:44 +0200 Subject: [PATCH] fix: Use _path_add for PATH entries appended at the end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit profile.d/path and rc.d/rvm concatenated onto PATH directly, so re-sourcing them in the same shell (source ~/.bashrc, a resourced tmux pane, etc.) would duplicate entries. _path_add already guards against that and tests directory existence itself. profile.d/krew and profile.d/anyenv are left untouched: they prepend to PATH (to take priority over other entries), while _path_add always appends — converting them would silently change resolution order. --- profile.d/path | 8 ++++---- rc.d/rvm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/profile.d/path b/profile.d/path index 3f8db46..f4465e4 100644 --- a/profile.d/path +++ b/profile.d/path @@ -1,6 +1,6 @@ # Customize PATH -if [ -d "${HOME}/.bin" ] ; then export PATH="${PATH}:${HOME}/.bin" ; fi -if [ -d "${HOME}/.local/bin" ] ; then export PATH="${PATH}:${HOME}/.local/bin" ; fi +_path_add "${HOME}/.bin" +_path_add "${HOME}/.local/bin" -if [ -d "${HOME}/bin" ] ; then export PATH="${PATH}:${HOME}/bin" ; fi -if [ -d "${HOME}/scripts" ] ; then export PATH="${PATH}:${HOME}/scripts" ; fi +_path_add "${HOME}/bin" +_path_add "${HOME}/scripts" diff --git a/rc.d/rvm b/rc.d/rvm index a14fc24..b270f08 100644 --- a/rc.d/rvm +++ b/rc.d/rvm @@ -5,4 +5,4 @@ [[ -r "${HOME}/.rvm/scripts/completion" ]] && source "${HOME}/.rvm/scripts/completion" # Add RVM to PATH for scripting -[[ -r "${HOME}/.rvm/bin" ]] && PATH="${PATH}:${HOME}/.rvm/bin" +[[ -r "${HOME}/.rvm/bin" ]] && _path_add "${HOME}/.rvm/bin"