-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathactivate
More file actions
executable file
·40 lines (32 loc) · 819 Bytes
/
activate
File metadata and controls
executable file
·40 lines (32 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
function deactivate() {
if [ -n "$GOENVNAME" ]; then
unset GOENVNAME
fi
if [ -n "$_OLD_GOROOT" ]; then
export GOROOT="$_OLD_GOROOT"
unset _OLD_GOROOT
fi
if [ -n "$_OLD_PS1" ]; then
export PS1="$_OLD_PS1"
unset _OLD_PS1
fi
if [ -n "$_OLD_PATH" ]; then
export PATH="$_OLD_PATH"
unset _OLD_PATH
fi
export GOPATH="$_OLD_GOPATH"
if [ "$1" != "init" ]; then
unset -f deactivate
fi
}
deactivate init
export _OLD_PATH="$PATH"
export _OLD_GOPATH="$GOPATH"
export _OLD_GOROOT="$GOROOT"
export _OLD_PS1="$PS1"
export GOENVNAME="."
export PS1="(go:.) $_OLD_PS1"
# 修改这里为自己项目的路径, 这个是使用 goenv(https://bitbucket.org/ymotongpoo/goenv) 生成的
export GOPATH=/Users/wyatt/Programer/golang/autorun
export PATH="$GOPATH/bin":$PATH