@@ -34,8 +34,8 @@ require "optparse"
3434require_relative "lib/matrix"
3535include Matrix
3636
37- # Shell run under the cell's Ruby. Writes the wrapper, re-resolves, and adds
38- # checksums where the bundler version supports them.
37+ # Shell run under the cell's Ruby. Writes the wrapper, re-resolves, adds
38+ # checksums, and normalizes platforms where the bundler version supports them.
3939#
4040# When FORCE is set, the existing lock is deleted first so bundler resolves from scratch, use for edge cases.
4141RESOLVE = <<~SH
@@ -46,12 +46,15 @@ RESOLVE = <<~SH
4646 echo "+ FORCE: removing $BUNDLE_GEMFILE.lock"
4747 rm -f "$BUNDLE_GEMFILE.lock"
4848 fi
49- # --add-checksums needs Bundler >= 2.5; fold it into the update where
50- # supported, and fall back to a plain update on older Rubies so they don't
51- # surface a flag-not-found error.
52- if bundle lock --help 2>&1 | grep -q -- --add-checksums; then
53- echo "+ bundle lock --update --add-checksums"
54- bundle lock --update --add-checksums
49+ lock_help="$(bundle lock --help 2>&1)"
50+ if echo "$lock_help" | grep -q -- --add-checksums; then
51+ if echo "$lock_help" | grep -q -- --normalize-platforms; then
52+ echo "+ bundle lock --update --add-checksums --normalize-platforms"
53+ bundle lock --update --add-checksums --normalize-platforms
54+ else
55+ echo "+ bundle lock --update --add-checksums"
56+ bundle lock --update --add-checksums
57+ fi
5558 else
5659 echo "+ bundle lock --update"
5760 bundle lock --update
0 commit comments