File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
2- set -e
3-
42echo " checking TRAVIS_TEST_RESULT"
53if [ " $TRAVIS_TEST_RESULT " != " 0" ]
64then
@@ -18,6 +16,12 @@ git push github HEAD:master --follow-tags
1816echo " generating github release notes"
1917GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
2018
19+ if [ $? -ne 0 ]
20+ then
21+ echo " gren fails, bye"
22+ exit 1
23+ fi
24+
2125echo " downloading github release info"
2226url=https://api.github.com/repos/$TRAVIS_REPO_SLUG /releases/latest
2327resp_tmp_file=resp.tmp
Original file line number Diff line number Diff line change 11#! /bin/sh
22# https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean
3- set -e
4-
53echo " 1/5: checking TRAVIS_TEST_RESULT"
64if [ " $TRAVIS_TEST_RESULT " != " 0" ]
75then
@@ -13,12 +11,20 @@ ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
1311REPO_NAME=$( echo " $TRAVIS_REPO_SLUG " | cut -d ' /' -f 2)
1412
1513echo " 2/5: pushing commit and tag to github"
14+ # 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
1615git remote add github https://$GITHUB_TOKEN @github.com/$TRAVIS_REPO_SLUG .git > /dev/null 2>&1
1716git push github HEAD:master --follow-tags
1817
1918echo " 3/5: generating github release notes"
2019GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
2120
21+ # 避免发送错误信息
22+ if [ $? -ne 0 ]
23+ then
24+ echo " gren fails, bye"
25+ exit 1
26+ fi
27+
2228echo " 4/5: downloading github release info"
2329url=https://api.github.com/repos/$TRAVIS_REPO_SLUG /releases/latest
2430resp_tmp_file=resp.tmp
You can’t perform that action at this time.
0 commit comments