Last active
December 14, 2015 12:18
-
-
Save allspiritseve/5084963 to your computer and use it in GitHub Desktop.
Alias to bundle exec for common rails commands
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
# Source : http://marc-bowes.com/2011/09/21/dry-your-bundle-exec-tears.html | |
# | |
# Add to ~/.bash_profile or ~/.bashrc | |
bundle_commands="rake rails unicorn" | |
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