Skip to content

Instantly share code, notes, and snippets.

@joshuapaling
Created June 5, 2019 10:27
Show Gist options
  • Save joshuapaling/02b43c99494e1462cd604908ca3b284e to your computer and use it in GitHub Desktop.
Save joshuapaling/02b43c99494e1462cd604908ca3b284e to your computer and use it in GitHub Desktop.
upgrade packages only if your tests pass
declare -a packages=(
"node-sass"
"react-qr-reader"
"moment-timezone"
"qs"
)
for i in "${packages[@]}"
do
yarn upgrade $i --latest --tilde
yarn install && yarn test
if [ "$?" = 0 ]; then
echo "############## YES UPGRADING $i #############"
git add .
git commit -m "yarn upgrade $i --latest --tilde"
else
echo "############## NOT UPGRADING $i #############"
git reset --hard
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment