aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bash_profile10
-rw-r--r--.bashrc2
2 files changed, 10 insertions, 2 deletions
diff --git a/.bash_profile b/.bash_profile
index 57ed40c..aa8c294 100644
--- a/.bash_profile
+++ b/.bash_profile
@@ -1,6 +1,14 @@
#!/bin/bash
# shellcheck disable=SC2016
+prefixPath() {
+ case ":$PATH:" in
+ *":$1:"*) true ;;
+ *) PATH="$1:$PATH" ;;
+ esac
+ export PATH;
+}
+
# set xauthority path
export XAUTHORITY=$HOME/.config/X11/Xauthority;
@@ -24,7 +32,7 @@ PS1_SSHD='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;32m\]\W\[\e[0m\] \[\e[0;32
[ -n "$SSH_CLIENT" ] && [ "$EUID" != 0 ] && export PS1="$PS1_SSHD";
# path exports
-[ -z "$BASH_PROFILE" ] && export PATH="$HOME/.local/bin:$PATH"
+prefixPath "$HOME/.local/bin";
# general exports
export CARGO_HOME="$XDG_CACHE_HOME/cargo"
diff --git a/.bashrc b/.bashrc
index 70fff04..9523b76 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,7 +1,7 @@
#!/bin/bash
# source exports
-export BASH_PROFILE=loaded && . "$HOME/.bash_profile";
+export BASH_PROFILE=1 && . "$HOME/.bash_profile";
# bail if not interactive
echo $- | grep -q "i" || return;