Skip to content

Instantly share code, notes, and snippets.

@binaryphile
Last active August 29, 2015 14:12
Show Gist options
  • Save binaryphile/cbe8296a082c2cf3aad5 to your computer and use it in GitHub Desktop.
Save binaryphile/cbe8296a082c2cf3aad5 to your computer and use it in GitHub Desktop.
bash function to handle bundler issue for mri when jruby uses vendor/cache
bundle()
{
if [ $# -eq 0 ] || [ "$1" == "install" ] ; then
shift
command bundle install --no-cache "$@"
else
command bundle "$@"
fi
}
@binaryphile
Copy link
Author

If for any reason you want to run "bundle install" without the --no-cache option being invoked, instead run "command bundle install".

P.S. this function will work fine for projects which don't have anything in vendor/cache since --no-cache becomes a no-op in that situation.

P.P.S. for bonus points, use this version instead: https://gist.github.com/binaryphile/cbe8296a082c2cf3aad5/e280b86c47b0c42ddeda177670aba3b13c0d4922. It runs "bundle check" to determine whether "bundle install" is even necessary, which runs twice as fast and outputs a single line instead of a wall of text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment