aboutsummaryrefslogtreecommitdiffstats
path: root/path.zsh
diff options
context:
space:
mode:
authorSimen A. W. Olsen <so@bjerk.io>2024-07-27 17:18:11 +0200
committerSimen A. W. Olsen <so@bjerk.io>2024-07-27 17:18:11 +0200
commitaffc30e13aa0e2053d70386663e5e0d5520e504a (patch)
tree5fa226bee76fc498aa5b2f5d6c481eaff4e989e5 /path.zsh
parentd296370b1ea7c6969a64a2c02e1eca84db223880 (diff)
downloaddotfiles-affc30e13aa0e2053d70386663e5e0d5520e504a.tar.gz
dotfiles-affc30e13aa0e2053d70386663e5e0d5520e504a.zip
clean up and refactor setup
Diffstat (limited to 'path.zsh')
-rw-r--r--path.zsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/path.zsh b/path.zsh
new file mode 100644
index 0000000..febb59e
--- /dev/null
+++ b/path.zsh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# Add directories to the PATH and prevent to add the same directory multiple times upon shell reload.
+add_to_path() {
+ if [[ -d "$1" ]] && [[ ":$PATH:" != *":$1:"* ]]; then
+ export PATH="$1:$PATH"
+ fi
+}
+
+# Add ghq to PATH
+add_to_path "$GOPATH/bin"
+