summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holman <dholman@gymli.org>2018-04-08 00:25:50 -0500
committerDaniel Holman <dholman@gymli.org>2018-04-08 00:25:50 -0500
commitce86b3802b591eed658670057f5e0e61fbeafa05 (patch)
tree9de5fb349706caae5d7ebe721f3b85a5d7b92191
parent928e507d33e1192ca1f8d3413a352c30909286fb (diff)
Fixed PATH issue in .zshenv
Fixed an issue in .zshenv in which the PATH environment variable would be appended with duplicate entries
-rw-r--r--.zshenv13
1 files changed, 12 insertions, 1 deletions
diff --git a/.zshenv b/.zshenv
index 7cd008d..8d18e93 100644
--- a/.zshenv
+++ b/.zshenv
@@ -1,5 +1,16 @@
+# Environment functions
+appendpath () {
+ case ":$PATH:" in
+ *:"$1":*)
+ ;;
+ *)
+ PATH="${PATH:+$PATH:}$1"
+ esac
+}
+
# Setup environment
-export PATH="$PATH:/home/dholman/bin"
+appendpath '/home/dholman/bin'
+export PATH
export EDITOR="vim"
export SUDO_EDITOR="vim"
export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0