diff options
author | zachir <zachir@librem.one> | 2023-10-23 00:14:52 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-10-23 00:17:17 -0500 |
commit | c599f7ea5d79030fdaae5df120898f5eeaf0559e (patch) | |
tree | 6a9ef448d889b4036caa3c6704c03247d8273ea3 | |
parent | 64d0c1f60e65464aa0be23d454eb389d88ce0756 (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 |