Input a test command to bundle update script

This commit is contained in:
Trevor Vallender 2023-06-13 08:52:57 +01:00
parent 305c257716
commit 4de0c6bcab
1 changed files with 4 additions and 2 deletions

View File

@ -7,13 +7,15 @@ if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
echo 'Usage: echo 'Usage:
bundle_update.sh test_command
' '
exit exit
fi fi
declare -a UPDATE_LEVELS=(patch minor major) declare -a UPDATE_LEVELS=(patch minor major)
dip test TEST_COMMAND=$1
$TEST_COMMAND
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Tests failed prior to updating any gems. Exiting." echo "Tests failed prior to updating any gems. Exiting."
exit exit
@ -24,7 +26,7 @@ git checkout -b "bundle_update_$DATE"
for level in "${UPDATE_LEVELS[@]}"; do for level in "${UPDATE_LEVELS[@]}"; do
dip bundle update --$level dip bundle update --$level
dip test $TEST_COMMAND
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Tests failed after $level update, rolling those changes back." echo "Tests failed after $level update, rolling those changes back."
git restore . git restore .