Last active
August 29, 2015 14:12
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bundle() | |
| { | |
| if [ $# -eq 0 ] || [ "$1" == "install" ] ; then | |
| shift | |
| command bundle install --no-cache "$@" | |
| else | |
| command bundle "$@" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.