Skip to content

Instantly share code, notes, and snippets.

@matthewrudy
Created June 2, 2011 04:13
Show Gist options
  • Save matthewrudy/1003927 to your computer and use it in GitHub Desktop.
Save matthewrudy/1003927 to your computer and use it in GitHub Desktop.
Does running `bundle exec rake` make you angry. Control your `rage`!
#!/usr/bin/env bash
#
# Usage: rage db:migrate --trace
# should work transparently like rake
#
# if we're in a directory controlled by bundler
# we do bundle exec rake
if [ -f Gemfile ]; then
bundle exec rake $@
# otherwise we use the system / rvm rake
else
rake $@
fi
@lemsx1
Copy link

lemsx1 commented Oct 14, 2011

well, i always use bundle now so for me is simpler to just do: (add to your ~/.alias.setup or ~/.bashrc)

alias rake='bundle exec rake $@'

And just keep typing "rake" as I usually do... it works just fine. (bundle exec looks for "rake" in whatever bundle path and it can't see your alias, which is just for your interactive shell)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment