Input a test command to bundle update script
This commit is contained in:
parent
305c257716
commit
4de0c6bcab
|
@ -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 .
|
||||
|
|
Loading…
Reference in New Issue