Skip to content

Instantly share code, notes, and snippets.

@jhirbour
Last active March 30, 2022 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhirbour/1b1e621f9084cdfa5b85fffee762fc15 to your computer and use it in GitHub Desktop.
Save jhirbour/1b1e621f9084cdfa5b85fffee762fc15 to your computer and use it in GitHub Desktop.
#!/bin/sh
bundler_version=$(bundler --version | awk '{print $3}')
gemfile_version=$(tail -1 Gemfile.lock | awk '{print $1}')
echo "bundler_version is $bundler_version"
echo "gemfile_version is $gemfile_version"
if [ "$bundler_version" = "$gemfile_version" ]; then
bundler "$@"
else
echo "ALERT!!!! *** CHANGE YOUR BUNDLER VERSION!!!! ***"
echo "You probably want to run 'gem install bundler:$gemfile_version'"
exit 1
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment