diff options
author | GitIR <git@zachir.xyz> | 2023-07-10 22:35:58 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-07-10 22:55:21 -0500 |
commit | a67cdb2231d1f8996df3445ec359b4681a7fd39f (patch) | |
tree | b0c2a38bd27f396b5eb338fd2c2ed9f79d480533 /zsh | |
parent | 139e7ca6ffc3025eda88f7d2e52d24613bbd199d (diff) |
Check if dirs exist before adding to path
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zshenv | 67 |
1 files changed, 44 insertions, 23 deletions
diff --git a/zsh/.zshenv b/zsh/.zshenv index bd3a94c..306e77f 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -84,28 +84,49 @@ 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/volsv" -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:/opt/crashsdk/bin" -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/volsv" ]; then + export PATH="$PATH:$HOME/.local/volsv" +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 "/var/lib/flatpak/exports/bin" ]; then + export PATH="$PATH:/var/lib/flatpak/exports/bin" +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 |