Skip to content

Instantly share code, notes, and snippets.

@Omer
Created July 1, 2011 10:32
Show Gist options
  • Save Omer/1058268 to your computer and use it in GitHub Desktop.
Save Omer/1058268 to your computer and use it in GitHub Desktop.
prefix bundle exec if Gemfile exists
preexec () { :; }
preexec_invoke_exec () {
if [[ -a Gemfile ]]; then
bundle exec $*
else
command $*
fi
}
trap 'preexec_invoke_exec' DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment