diff --git a/build.sh b/build.sh index 6474b59..7705a14 100644 --- a/build.sh +++ b/build.sh @@ -53,8 +53,8 @@ if [[ $ARCH != '386' && $ARCH != 'amd64' ]];then fi echo '开始编译' -GOOS=$OS GOARCH=$ARCH go build -if [[ ! $? ]];then +GOOS=$OS GOARCH=$ARCH go build -ldflags '-w' +if [[ $? != 0 ]];then exit 1 fi echo '编译完成' @@ -68,7 +68,7 @@ else fi mkdir -p $TEMP_DIR/$APP_NAME -if [[ ! $? ]]; then +if [[ $? != 0 ]]; then exit 1 fi diff --git a/upload_package_to_qiniu.sh b/upload_package_to_qiniu.sh index f4f4c11..245b05a 100644 --- a/upload_package_to_qiniu.sh +++ b/upload_package_to_qiniu.sh @@ -11,7 +11,7 @@ fi for i in linux darwin windows do ./build.sh -p $i - if [[ ! $? ]];then + if [[ $? != 0 ]];then break fi done @@ -25,7 +25,7 @@ do # 上传文件 qrsctl put bucket key srcFile KEY=gocron/$i qrsctl put github $KEY $i - if [[ ! $? ]];then + if [[ $? != 0 ]];then break fi echo "刷新七牛CDN-" $QINIU_URL/$KEY