Created
February 28, 2014 19:51
-
-
Save danielspector/9278465 to your computer and use it in GitHub Desktop.
Automatically append bundle exec to specified commands. HT http://twistedmind.com/bundle-exec-bash-shortcut
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_commands=( spec rspec cucumber cap watchr rails rackup shotgun ) | |
| function run_bundler_cmd () { | |
| if [ -e ./Gemfile ]; then | |
| echo "bundle exec $@" | |
| bundle exec $@ | |
| else | |
| echo "$@" | |
| $@ | |
| fi | |
| } | |
| for cmd in $bundle_commands | |
| do | |
| alias $cmd="run_bundler_cmd $cmd" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment