summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-10-23 00:14:52 -0500
committerzachir <zachir@librem.one>2023-10-23 00:14:52 -0500
commit0d7e5e6923cd04b6f10a15074878e35704f461dc (patch)
treeaeb38c4acb4c2e06de815ffb3ac7d0e7143570ce /sh
parentf31b68f7badd5d0dce44da570376c5a22c843ed3 (diff)
New addtopath function to fix issues with PATH var
Diffstat (limited to 'sh')
-rw-r--r--sh/profile36
1 files changed, 22 insertions, 14 deletions
diff --git a/sh/profile b/sh/profile
index 79151b9..901c581 100644
--- a/sh/profile
+++ b/sh/profile
@@ -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