]> arthur.barton.de Git - ax-zsh.git/blob - plugins/go/go.zprofile
New "mankier" plugin
[ax-zsh.git] / plugins / go / go.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # go.zprofile: Setup Go environment.
3
4 # Make sure that "go(1)" is installed
5 (( $+commands[go] )) || return
6
7 # Try to detect existing GOPATH directory ...
8 if [[ -z "$GOPATH" ]]; then
9         for gopath in $HOME/.go $HOME/go; do
10                 if [[ -d "$gopath" ]]; then
11                         GOPATH="$gopath"
12                         break
13                 fi
14         done
15         unset gopath
16 fi
17
18 # Make sure a GOPATH directory exists:
19 if [[ -z "$GOPATH" ]]; then
20         GOPATH="$HOME/.go"
21         mkdir -p "$GOPATH"
22 fi
23
24 path+=("$GOPATH/bin")
25 export GOPATH