diff options
Diffstat (limited to 'scripts/gemfile_lock_changed.sh')
-rwxr-xr-x | scripts/gemfile_lock_changed.sh | 26 |
1 files changed, 26 insertions, 0 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 |