aboutsummaryrefslogtreecommitdiffstats
path: root/.path.zsh
blob: febb59e5b40f7413e1689749b2d28c5fbb838bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
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"