From a67cdb2231d1f8996df3445ec359b4681a7fd39f Mon Sep 17 00:00:00 2001 From: GitIR Date: Mon, 10 Jul 2023 22:35:58 -0500 Subject: Check if dirs exist before adding to path --- zsh/.zshenv | 67 ++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 23 deletions(-) (limited to 'zsh') 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 -- cgit v1.2.3