aboutsummaryrefslogtreecommitdiff
path: root/.bash_profile
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2020-12-22 02:43:32 -0500
committertdro <tdro@users.noreply.github.com>2020-12-23 01:27:54 -0500
commit0d5afea232d5ac174e0e9ced2f8a8802b43d55f8 (patch)
tree26b5879dc714d7299318d9ab4770d81951e5b192 /.bash_profile
parent7bd85e987c52846659cfb4d4e8f3c672e17a90cb (diff)
downloaddotfiles-0d5afea232d5ac174e0e9ced2f8a8802b43d55f8.tar.gz
dotfiles-0d5afea232d5ac174e0e9ced2f8a8802b43d55f8.tar.bz2
dotfiles-0d5afea232d5ac174e0e9ced2f8a8802b43d55f8.zip
.bash_profile: Just prefix path
Avoid duplicate paths since .bashrc and .bash_profile are calling each other.
Diffstat (limited to '.bash_profile')
-rw-r--r--.bash_profile10
1 files changed, 9 insertions, 1 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"