File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,15 @@ function lernaPublishExitOnFailure {
8
8
set -e
9
9
# run lerna publish with the args that were passed to this function
10
10
# duplicate stdout to a temp file
11
- # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
12
- npx lerna publish " $@ " | tee /tmp/publish-results && grep -qvz " lerna ERR!" < /tmp/publish-results
11
+ npx lerna publish " $@ " | tee /tmp/publish-results
12
+ # grep the temp file for the lerna err token and return exit 1
13
+ number_of_lerna_errors=$( grep " lerna ERR" /tmp/publish-results | wc -l)
14
+ if [[ number_of_lerna_errors -gt 0 ]]; then
15
+ echo " Fail! Lerna error."
16
+ exit 1;
17
+ else
18
+ echo " Success! Lerna publish succeeded."
19
+ fi
13
20
}
14
21
15
22
npmRegistryUrl=$( npm get registry)
Original file line number Diff line number Diff line change @@ -8,8 +8,15 @@ function lernaPublishExitOnFailure {
8
8
set -e
9
9
# run lerna publish with the args that were passed to this function
10
10
# duplicate stdout to a temp file
11
- # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code)
12
- npx lerna publish " $@ " | tee /tmp/publish-results && grep -qvz " lerna ERR!" < /tmp/publish-results
11
+ npx lerna publish " $@ " | tee /tmp/publish-results
12
+ # grep the temp file for the lerna err token and return exit 1
13
+ number_of_lerna_errors=$( grep " lerna ERR" /tmp/publish-results | wc -l)
14
+ if [[ number_of_lerna_errors -gt 0 ]]; then
15
+ echo " Fail! Lerna error."
16
+ exit 1;
17
+ else
18
+ echo " Success! Lerna publish succeeded."
19
+ fi
13
20
}
14
21
15
22
# verifies that binaries are uploaded and available before publishing to NPM
You can’t perform that action at this time.
0 commit comments