Skip to content

Commit 0f933c3

Browse files
author
levy
committed
Merge branch 'dev'
2 parents 994d743 + 5492384 commit 0f933c3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

notify.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/sh
2-
set -e
3-
42
echo "checking TRAVIS_TEST_RESULT"
53
if [ "$TRAVIS_TEST_RESULT" != "0" ]
64
then
@@ -18,6 +16,12 @@ git push github HEAD:master --follow-tags
1816
echo "generating github release notes"
1917
GREN_GITHUB_TOKEN=$GITHUB_TOKEN yarn release
2018

19+
if [ $? -ne 0 ]
20+
then
21+
echo "gren fails, bye"
22+
exit 1
23+
fi
24+
2125
echo "downloading github release info"
2226
url=https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest
2327
resp_tmp_file=resp.tmp

templates/notify.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/sh
22
# https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean
3-
set -e
4-
53
echo "1/5: checking TRAVIS_TEST_RESULT"
64
if [ "$TRAVIS_TEST_RESULT" != "0" ]
75
then
@@ -13,12 +11,20 @@ ORG_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 1)
1311
REPO_NAME=$(echo "$TRAVIS_REPO_SLUG" | cut -d '/' -f 2)
1412

1513
echo "2/5: pushing commit and tag to github"
14+
# 该命令很可能报错,但不影响实际进行,因而不能简单地在脚本开头 set -e
1615
git remote add github https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git > /dev/null 2>&1
1716
git push github HEAD:master --follow-tags
1817

1918
echo "3/5: generating github release notes"
2019
GREN_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+
2228
echo "4/5: downloading github release info"
2329
url=https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest
2430
resp_tmp_file=resp.tmp

0 commit comments

Comments
 (0)