diff --git a/_home/dot_bashrc b/_home/dot_bashrc index 12a3b54..baa6048 100644 --- a/_home/dot_bashrc +++ b/_home/dot_bashrc @@ -13,7 +13,7 @@ if [ -d ~/.sz.shrc.d ]; then script_source+=("$(find ~/.sz.shrc.d -maxdepth 0 -type d)") script_source+=("$(find ~/.sz.shrc.d -maxdepth 1 -type d -name "$(ps -p$$ -ho comm).post")") for script_src in ${script_source[@]}; do - scripts=$(find $script_src -maxdepth 1 -type f -not -name "*.off" | sort) + scripts=$(find $script_src -maxdepth 1 -type f -not -name "*.off" -not -name "*.swp" | sort) for script_name in $scripts; do if [ -r $script_name ]; then [ -z ${DBG_SZSHRC} ] || echo "Sourcing $script_name..." diff --git a/_home/dot_sz.shrc.d/10_bin.path b/_home/dot_sz.shrc.d/10_bin.path deleted file mode 100644 index d75f257..0000000 --- a/_home/dot_sz.shrc.d/10_bin.path +++ /dev/null @@ -1,9 +0,0 @@ -# set PATH so it includes user's private bin if it exists -if [[ -d "$HOME/bin" ]] ; then - export PATH="~/bin:$PATH" -fi - -# set PATH so it includes user's private bin if it exists -if [[ -d "$HOME/.local/bin" ]] ; then - export PATH="~/.local/bin:$PATH" -fi diff --git a/_home/dot_sz.shrc.d/10_path.env b/_home/dot_sz.shrc.d/10_path.env new file mode 100644 index 0000000..6f95470 --- /dev/null +++ b/_home/dot_sz.shrc.d/10_path.env @@ -0,0 +1,18 @@ +get_clean_path() { + sed 's/ *:\?$//g;s/`/``/g;s/:/`:`/g;s/\\`:`/\\:/g;' <<< $1 | \ + awk -v RS='`:`' -v ORS='`:`' '!arr[$0]++' | \ + sed 's/`:`/:/g;s/:$//g' +} + +# set PATH so it includes user's private bin if it exists +if [[ -d "$HOME/bin" ]] ; then + export PATH="$HOME/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [[ -d "$HOME/.local/bin" ]] ; then + export PATH="$HOME/.local/bin:$PATH" +fi + +PATH=$( get_clean_path $PATH ) + diff --git a/_home/dot_sz.shrc.d/97_keyboard_mappings b/_home/dot_sz.shrc.d/91_keyboard_mappings similarity index 100% rename from _home/dot_sz.shrc.d/97_keyboard_mappings rename to _home/dot_sz.shrc.d/91_keyboard_mappings diff --git a/_home/dot_sz.shrc.d/98_chezmoi b/_home/dot_sz.shrc.d/97_chezmoi_aliases similarity index 82% rename from _home/dot_sz.shrc.d/98_chezmoi rename to _home/dot_sz.shrc.d/97_chezmoi_aliases index 9affbc9..8828eb1 100644 --- a/_home/dot_sz.shrc.d/98_chezmoi +++ b/_home/dot_sz.shrc.d/97_chezmoi_aliases @@ -12,8 +12,4 @@ if [[ -n "$(type -fP chezmoi)" ]]; then chezmoi git -- remote set-url origin "$(chezmoi git -- remote get-url origin | sed 's|git@github.com:|https://github.com/|')" chezmoi git -- remote get-url origin } - - CHEZMOI_OUT="$(chezmoi status || true)x" - [[ "x" != "$CHEZMOI_OUT" ]] && printf "\nChezmoi changes:\n" && echo "${CHEZMOI_OUT%?}" - unset CHEZMOI_OUT fi diff --git a/_home/dot_sz.shrc.d/98_chezmoi_status.off b/_home/dot_sz.shrc.d/98_chezmoi_status.off new file mode 100644 index 0000000..17106ec --- /dev/null +++ b/_home/dot_sz.shrc.d/98_chezmoi_status.off @@ -0,0 +1,5 @@ +if [[ -n "$(type -fP chezmoi)" ]]; then + CHEZMOI_OUT="$(chezmoi status || true)x" + [[ "x" != "$CHEZMOI_OUT" ]] && printf "\nChezmoi changes:\n" && echo "${CHEZMOI_OUT%?}" + unset CHEZMOI_OUT +fi