Skip to content

Instantly share code, notes, and snippets.

@ivey
Created October 21, 2011 18:06
Show Gist options
  • Save ivey/1304518 to your computer and use it in GitHub Desktop.
Save ivey/1304518 to your computer and use it in GitHub Desktop.
# http://twistedmind.com/bundle-exec-bash-shortcut
bundle_commands=( rake spec rspec cucumber cap watchr rails rackup )
function run_bundler_cmd () {
if [ -e ./Gemfile ]; then
echo "bundle exec $@"
bundle exec $@
else
echo "$@"
$@
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