Created
August 3, 2011 00:44
-
-
Save rafaelss/1121637 to your computer and use it in GitHub Desktop.
This file contains 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
function _bundle_exec() { | |
if [ -e Gemfile ]; then | |
grep -q "$1" "Gemfile.lock" | |
if [[ "$1" == "ruby" || $? -eq 0 ]]; then | |
echo "bundle exec $@" | |
bundle exec $@ | |
return | |
fi | |
fi | |
$@ | |
} | |
for cmd in ruby rails rake rspec | |
do | |
alias $cmd="_bundle_exec $cmd" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
!/bin/bash or zsh?