summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitIR <git@zachir.xyz>2023-07-10 22:35:58 -0500
committerZachIR <zachir@zdx-raina>2023-07-10 22:41:16 -0500
commitc649953048f0f1213f2fcb5d898aaa730ef9b39a (patch)
treef49aacae44b364c9c04dc68611b703cc2a143093
parent593eb0c5dec831863188e87cc4e4d4826ef9384d (diff)
Add PATH checking if dir exists
-rw-r--r--zsh/.zshenv86
1 files changed, 65 insertions, 21 deletions
diff --git a/zsh/.zshenv b/zsh/.zshenv
index 228d6f8..70b37b1 100644
--- a/zsh/.zshenv
+++ b/zsh/.zshenv
@@ -79,26 +79,70 @@ export SRCDIR="$HOME/.local/src"
export ENV="$XDG_CONFIG_HOME/mksh/mkshrc"
# PATH
-export PATH="$HOME/.local/bin/testing"
-export PATH="$PATH:$HOME/.local/bin/shortcmds"
-export PATH="$PATH:$HOME/.local/bin/generics"
-export PATH="$PATH:$HOME/.local/bin/scripts"
-export PATH="$PATH:$HOME/.local/bin/sp"
-export PATH="$PATH:$HOME/.local/bin/blocks"
-export PATH="$PATH:$HOME/.local/bin/ignore"
-export PATH="$PATH:$HOME/.local/bin"
-export PATH="$PATH:$HOME/.local/bin/flatpak-sc"
-export PATH="$PATH:$HOME/.local/share/flatpak/exports/bin/"
-export PATH="$PATH:$CARGO_HOME/bin"
-export PATH="$PATH:$GOPATH/bin"
-export PATH="$PATH:/opt/REAPER"
-export PATH="$PATH:/usr/local/bin"
-export PATH="$PATH:/usr/local/sbin"
-export PATH="$PATH:/opt/safing/portmaster"
-export PATH="$PATH:/var/lib/flatpak/exports/bin"
-export PATH="$PATH:/usr/bin"
-export PATH="$PATH:/usr/sbin"
-export PATH="$PATH:/bin"
-export PATH="$PATH:/sbin"
+if [ -d "$HOME/.local/bin/testing" ]; then
+ export PATH="$HOME/.local/bin/testing"
+fi
+if [ -d "$HOME/.local/bin/shortcmds" ]; then
+ export PATH="$PATH:$HOME/.local/bin/shortcmds"
+fi
+if [ -d "$HOME/.local/bin/generics" ]; then
+ export PATH="$PATH:$HOME/.local/bin/generics"
+fi
+if [ -d "$HOME/.local/bin/scripts" ]; then
+ export PATH="$PATH:$HOME/.local/bin/scripts"
+fi
+if [ -d "$HOME/.local/bin/sp" ]; then
+ export PATH="$PATH:$HOME/.local/bin/sp"
+fi
+if [ -d "$HOME/.local/bin/blocks" ]; then
+ export PATH="$PATH:$HOME/.local/bin/blocks"
+fi
+if [ -d "$HOME/.local/bin/ignore" ]; then
+ export PATH="$PATH:$HOME/.local/bin/ignore"
+fi
+if [ -d "$HOME/.local/bin" ]; then
+ export PATH="$PATH:$HOME/.local/bin"
+fi
+if [ -d "$HOME/.local/bin/flatpak-sc" ]; then
+ export PATH="$PATH:$HOME/.local/bin/flatpak-sc"
+fi
+if [ -d "$HOME/.local/bin/flatpak/exports/bin" ]; then
+ export PATH="$PATH:$HOME/.local/share/flatpak/exports/bin/"
+fi
+if [ -d "$CARGO_HOME/bin" ]; then
+ export PATH="$PATH:$CARGO_HOME/bin"
+fi
+if [ -d "$GOPATH/bin" ]; then
+ export PATH="$PATH:$GOPATH/bin"
+fi
+if [ -d "/opt/REAPER" ]; then
+ export PATH="$PATH:/opt/REAPER"
+fi
+if [ -d "/usr/local/bin" ]; then
+ export PATH="$PATH:/usr/local/bin"
+fi
+if [ -d "/usr/local/sbin" ]; then
+ export PATH="$PATH:/usr/local/sbin"
+fi
+if [ -d "/opt/safing/portmaster" ]; then
+ export PATH="$PATH:/opt/safing/portmaster"
+fi
+if [ -d "/var/lib/flatpak/exports/bin" ]; then
+ export PATH="$PATH:/var/lib/flatpak/exports/bin"
+fi
+if [ -d "/usr/bin" ]; then
+ export PATH="$PATH:/usr/bin"
+fi
+if [ -d "/usr/sbin" ]; then
+ export PATH="$PATH:/usr/sbin"
+fi
+if [ -d "/bin" ]; then
+ export PATH="$PATH:/bin"
+fi
+if [ -d "/sbin" ]; then
+ export PATH="$PATH:/sbin"
+fi
+
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
[ -f /etc/profile.d/nix-daemon.sh ] && . /etc/profile.d/nix-daemon.sh