aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2019-02-21 15:45:09 +0100
committerDuncaen <mail@duncano.de>2019-02-21 15:45:09 +0100
commite8c304a65708631208b4d2f7c234d643bd5ca7f9 (patch)
tree645512d04514cfa54839cc84c00656733314bd4b
parent6eb42bc30e9c9a2692a3da7f836aab2a0a20b1c8 (diff)
downloaddotfiles-e8c304a65708631208b4d2f7c234d643bd5ca7f9.tar.gz
profile: only add to path if its not already there
-rw-r--r--profile24
1 files changed, 19 insertions, 5 deletions
diff --git a/profile b/profile
index d31a7a3..f1d3c16 100644
--- a/profile
+++ b/profile
@@ -3,11 +3,25 @@ EDITOR=vim
PAGER=less
VISUAL=vim
-MANWIDTH=80
-
GCC_COLORS="locus=34"
-GOPATH="$HOME/go"
-PATH="$HOME/bin:$HOME/.local/bin:/usr/local/bin:/usr/local/lobase/bin:/usr/local/lobase/sbin:$PATH:$GOPATH/bin:/usr/local/plan9/bin"
+: ${GOPATH:="$HOME/go"}
+: ${XDG_RUNTIME_DIR:=/run/$USER}
+
+for x in \
+ "/usr/local/bin" \
+ "/usr/local/lobase/bin" \
+ "/usr/local/lobase/sbin" \
+ "$HOME/.local/bin" \
+ "$HOME/.cargo/bin" \
+ "$HOME/.cabal/bin" \
+ "$GOPATH/bin" \
+ "$HOME/bin"; do
+ [ -d "$x" ] || continue
+ case "$PATH" in
+ *"$x"*) ;;
+ *) PATH="$x:$PATH" ;;
+ esac
+done
-export BROWSER EDITOR GOPATH MANWIDTH PAGER PATH VISUAL GCC_COLORS
+export BROWSER EDITOR PAGER PATH VISUAL GCC_COLORS XDG_RUNTIME_DIR GOPATH