生成windows二进制文件, 隐藏窗口, 后台运行

pull/21/merge
ouqiang 2017-05-20 14:45:28 +08:00
parent 4a77958556
commit 519c6613c7
1 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,12 @@ if [[ $ARCH != '386' && $ARCH != 'amd64' ]];then
fi
echo '开始编译'
GOOS=$OS GOARCH=$ARCH go build -ldflags '-w'
if [[ $OS = 'windows' ]];then
GOOS=$OS GOARCH=$ARCH go build -ldflags '-w -H windowsgui'
else
GOOS=$OS GOARCH=$ARCH go build -ldflags '-w'
fi
if [[ $? != 0 ]];then
exit 1
fi