Make sure to exit publish script with correct code (#10310)

This commit is contained in:
JJ Kasper 2020-01-28 13:03:32 -06:00 committed by Joe Haddad
parent ee9ccc84cc
commit 6a88ec1852

View file

@ -18,6 +18,11 @@ if [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];
then then
echo "Publishing canary" echo "Publishing canary"
yarn run lerna publish from-git --npm-tag canary --yes yarn run lerna publish from-git --npm-tag canary --yes
# Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then
exit 1;
fi
else else
echo "Did not publish canary" echo "Did not publish canary"
fi fi
@ -25,6 +30,11 @@ fi
if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then if [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]];then
echo "Publishing stable" echo "Publishing stable"
yarn run lerna publish from-git --yes yarn run lerna publish from-git --yes
# Make sure to exit script with code 1 if publish failed
if [[ ! $? -eq 0 ]];then
exit 1;
fi
else else
echo "Did not publish stable" echo "Did not publish stable"
fi fi