Created
September 4, 2014 18:21
-
-
Save bahelms/befb2bd25e6e1cf1fb51 to your computer and use it in GitHub Desktop.
Alias bundle exec for common commands to avoid typing
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
In your .bashrc/.bash_profile paste the following (add any other commands to bundle_commands): | |
bundle_commands="sidekiq spring rake spec rspec cap rails rackup guard middleman" | |
function run_bundler_cmd () { | |
if [ -r ./Gemfile ]; then | |
bundle exec $@ | |
else | |
$@ | |
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