diff options
author | GitIR <git@zachir.xyz> | 2023-07-10 22:35:58 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-07-18 00:17:40 -0500 |
commit | 0547bc65b54aef2b3a57fda75603f085337d7505 (patch) | |
tree | 2100e69dadb33c83fc9790e144766ce6c2d374fb /zsh | |
parent | cc47caf5323249c699444f6503fced531feed81c (diff) |
Add PATH checking if dir exists
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zshenv | 86 |
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 |