Skip to content

Instantly share code, notes, and snippets.

@bahelms
Created September 4, 2014 18:21
Show Gist options
  • Save bahelms/befb2bd25e6e1cf1fb51 to your computer and use it in GitHub Desktop.
Save bahelms/befb2bd25e6e1cf1fb51 to your computer and use it in GitHub Desktop.
Alias bundle exec for common commands to avoid typing
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