diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gemfile_lock_changed.sh | 26 | ||||
-rwxr-xr-x | scripts/static-analysis | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/scripts/gemfile_lock_changed.sh b/scripts/gemfile_lock_changed.sh new file mode 100755 index 00000000000..24e2c685f11 --- /dev/null +++ b/scripts/gemfile_lock_changed.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +gemfile_lock_changed() { + if [ -n "$(git diff --name-only -- Gemfile.lock)" ]; then + cat << EOF + Gemfile was updated but Gemfile.lock was not updated. + + Usually, when Gemfile is updated, you should run + \`\`\` + bundle install + \`\`\` + + or + + \`\`\` + bundle update <the-added-or-updated-gem> + \`\`\` + + and commit the Gemfile.lock changes. +EOF + + exit 1 + fi +} + +gemfile_lock_changed diff --git a/scripts/static-analysis b/scripts/static-analysis index 1f55c035ed1..251462fad33 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -49,7 +49,8 @@ def jobs_to_run(node_index, node_total) %w[scripts/lint-conflicts.sh], %w[scripts/lint-rugged], %w[scripts/frontend/check_no_partial_karma_jest.sh], - %w[scripts/lint-changelog-filenames] + %w[scripts/lint-changelog-filenames], + %w[scripts/gemfile_lock_changed.sh] ] case node_total |