diff --git a/.circleci/cb-publish-step-2-verdaccio.sh b/.circleci/cb-publish-step-2-verdaccio.sh index c27881e6d6d..44fffb52db7 100755 --- a/.circleci/cb-publish-step-2-verdaccio.sh +++ b/.circleci/cb-publish-step-2-verdaccio.sh @@ -8,8 +8,15 @@ function lernaPublishExitOnFailure { set -e # run lerna publish with the args that were passed to this function # duplicate stdout to a temp file - # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code) - npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results + npx lerna publish "$@" | tee /tmp/publish-results + # grep the temp file for the lerna err token and return exit 1 + number_of_lerna_errors=$(grep "lerna ERR" /tmp/publish-results | wc -l) + if [[ number_of_lerna_errors -gt 0 ]]; then + echo "Fail! Lerna error." + exit 1; + else + echo "Success! Lerna publish succeeded." + fi } npmRegistryUrl=$(npm get registry) diff --git a/.circleci/cb-publish-step-3-npm.sh b/.circleci/cb-publish-step-3-npm.sh index d8c79723de2..8fb2606a1af 100755 --- a/.circleci/cb-publish-step-3-npm.sh +++ b/.circleci/cb-publish-step-3-npm.sh @@ -8,8 +8,15 @@ function lernaPublishExitOnFailure { set -e # run lerna publish with the args that were passed to this function # duplicate stdout to a temp file - # grep the temp file for the lerna err token and return exit 1 if found (-v option inverts grep exit code) - npx lerna publish "$@" | tee /tmp/publish-results && grep -qvz "lerna ERR!" < /tmp/publish-results + npx lerna publish "$@" | tee /tmp/publish-results + # grep the temp file for the lerna err token and return exit 1 + number_of_lerna_errors=$(grep "lerna ERR" /tmp/publish-results | wc -l) + if [[ number_of_lerna_errors -gt 0 ]]; then + echo "Fail! Lerna error." + exit 1; + else + echo "Success! Lerna publish succeeded." + fi } # verifies that binaries are uploaded and available before publishing to NPM