Add mkgoenv
This commit is contained in:
parent
357d521798
commit
e1073078ce
1 changed files with 22 additions and 0 deletions
22
bin/mkgoenv
Executable file
22
bin/mkgoenv
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "mkgoenv GO_IMPORT PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $2
|
||||
|
||||
cat <<EOF > $2/activate.sh
|
||||
# Absolute path this script is in. /home/user/bin
|
||||
cd "\`dirname '\${BASH_SOURCE:-\$0}'\`"
|
||||
SCRIPTPATH="\`pwd\`"
|
||||
echo \$dir
|
||||
cd - > /dev/null
|
||||
|
||||
export GOPATH=\$SCRIPTPATH
|
||||
#export GOOS="linux"
|
||||
#export GOARCH="amd64"
|
||||
|
||||
gocode set lib-path \$SCRIPTPATH
|
||||
cd src/$1
|
||||
EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue