Skip to content

Commit 639ad76

Browse files
committed
Add error handling to bundler downgrade
`set -e` stops the script when a *simple command* fails. If the command is part of an `||`-expression, the script continues. It seems unessential that we fail to uninstall `bundler` from the global gemset, the build is green after all.
1 parent 8b0e8d6 commit 639ad76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

script/downgrade_bundler_on_old_rails

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ if ruby -e "exit(ENV['RAILS_VERSION'].scan(/\d+\.\d+.\d+/)[0].to_f < 5)"; then
1111

1212
gem uninstall -aIx bundler || echo "Warning error occured removing bundler via gem"
1313

14+
echo "Does it fail to execute the script further here?"
15+
1416
# this only works on Ruby 2.3 which is luckily the version we need to fix
1517
if ruby -e "exit(RUBY_VERSION.to_f == 2.3)"; then
16-
rvm @global do gem uninstall -aIx bundler
18+
rvm @global do gem uninstall -aIx bundler || echo "Warning: error occured removing bundler from the global RVM gemset"
1719
fi
1820

1921
gem install bundler -v '1.17.3'

0 commit comments

Comments
 (0)