diff options
author | zachir <zachir@librem.one> | 2023-10-23 00:14:52 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-11-05 17:28:50 -0600 |
commit | 2479199d10ac76478fd61e0df0fabaad9d75f7ce (patch) | |
tree | 384954e4e23dd0cc47b8c5d66b0e71f290c18055 | |
parent | 9f3a705eee2f27ce72937e8484a58688ca6786e5 (diff) |
New addtopath function to fix issues with PATH var
-rw-r--r-- | sh/profile | 36 |
1 files changed, 22 insertions, 14 deletions
@@ -85,48 +85,56 @@ export SRCDIR="$HOME/.local/src" export SYSPATH="$PATH" # NEW PATH +addtopath () { + if [ -n "$PATH" ]; then + PATH="$@:$PATH" + else + PATH="$@" + fi +} + unset PATH if [ -d "$HOME/.local/bin/testing" ]; then - PATH="$HOME/.local/bin/testing" + addtopath "$HOME/.local/bin/testing" fi if [ -d "$HOME/.local/bin/shortcmds" ]; then - PATH="$PATH:$HOME/.local/bin/shortcmds" + addtopath "$HOME/.local/bin/shortcmds" fi if [ -d "$HOME/.local/bin/generics" ]; then - PATH="$PATH:$HOME/.local/bin/generics" + addtopath "$HOME/.local/bin/generics" fi if [ -d "$HOME/.local/bin/scripts" ]; then - PATH="$PATH:$HOME/.local/bin/scripts" + addtopath "$HOME/.local/bin/scripts" fi if [ -d "$HOME/.local/bin/sp" ]; then - PATH="$PATH:$HOME/.local/bin/sp" + addtopath "$HOME/.local/bin/sp" fi if [ -d "$HOME/.local/bin/blocks" ]; then - PATH="$PATH:$HOME/.local/bin/blocks" + addtopath "$HOME/.local/bin/blocks" fi if [ -d "$HOME/.local/bin/ignore" ]; then - PATH="$PATH:$HOME/.local/bin/ignore" + addtopath "$HOME/.local/bin/ignore" fi if [ -d "$HOME/local/bin/volsv" ]; then - PATH="$PATH:$HOME/.local/volsv" + addtopath "$HOME/.local/volsv" fi if [ -d "$HOME/.local/bin" ]; then - PATH="$PATH:$HOME/.local/bin" + addtopath "$HOME/.local/bin" fi if [ -d "$HOME/.local/bin/flatpak-sc" ]; then - PATH="$PATH:$HOME/.local/bin/flatpak-sc" + addtopath "$HOME/.local/bin/flatpak-sc" fi if [ -d "$HOME/.local/bin/flatpak/exports/bin" ]; then - PATH="$PATH:$HOME/.local/share/flatpak/exports/bin/" + addtopath "$HOME/.local/share/flatpak/exports/bin/" fi if [ -d "$CARGO_HOME/bin" ]; then - PATH="$PATH:$CARGO_HOME/bin" + addtopath "$CARGO_HOME/bin" fi if [ -d "$GOPATH/bin" ]; then - PATH="$PATH:$GOPATH/bin" + addtopath "$GOPATH/bin" fi if [ -d "/var/lib/flatpak/exports/bin" ]; then - PATH="$PATH:/var/lib/flatpak/exports/bin" + addtopath "/var/lib/flatpak/exports/bin" fi # MERGE PATHS |