代码拉取完成,页面将自动刷新
#!/bin/bash
function usage {
local tool=$(basename $0)
cat <<EOF
USAGE:
$ $tool [-h|--help] COMMAND
EXAMPLES:
$ $tool deps Install dependencies for joe
$ $tool build Build a binary
$ $tool run Build and run the binary
EOF
exit 1;
}
function build {
GOOS=windows GOARCH=386 go build -o build/joe-x86.exe joe.go utils.go
GOOS=windows GOARCH=amd64 go build -o build/joe.exe joe.go utils.go
GOOS=linux GOARCH=386 go build -o build/joe-x86 joe.go utils.go
GOOS=linux GOARCH=amd64 go build -o build/joe joe.go utils.go
GOOS=darwin GOARCH=386 go build -o build/joe-darwin-x86 joe.go utils.go
GOOS=darwin GOARCH=amd64 go build -o build/joe-darwin joe.go utils.go
printf 'joe built\n';
}
# total arguments should be 1
if [ $# -ne 1 ]; then
usage;
fi
if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ] || [ "$1" == '--help' ]
then
usage;
fi
# show help for no arguments if stdin is a terminal
if [ "$1" == "deps" ]; then
go get github.com/codegangsta/cli
go get github.com/termie/go-shutil
elif [ "$1" == "build" ]; then
build
elif [ "$1" == "run" ]; then
build && ./joe
else
usage;
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。