From 4de0c6bcabe85f9bc413de66ccfb096ec2f48161 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Tue, 13 Jun 2023 08:52:57 +0100 Subject: [PATCH] Input a test command to bundle update script --- bundle_update.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundle_update.sh b/bundle_update.sh index 8066a37..024dd51 100755 --- a/bundle_update.sh +++ b/bundle_update.sh @@ -7,13 +7,15 @@ if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then echo 'Usage: + bundle_update.sh test_command ' exit fi declare -a UPDATE_LEVELS=(patch minor major) -dip test +TEST_COMMAND=$1 +$TEST_COMMAND if [ $? -ne 0 ]; then echo "Tests failed prior to updating any gems. Exiting." exit @@ -24,7 +26,7 @@ git checkout -b "bundle_update_$DATE" for level in "${UPDATE_LEVELS[@]}"; do dip bundle update --$level - dip test + $TEST_COMMAND if [ $? -ne 0 ]; then echo "Tests failed after $level update, rolling those changes back." git restore .