Skip to content

Instantly share code, notes, and snippets.

@vitaly
Created June 6, 2011 16:20
Show Gist options
  • Save vitaly/1010573 to your computer and use it in GitHub Desktop.
Save vitaly/1010573 to your computer and use it in GitHub Desktop.
✗ which bundle
bundle () {
if (
unset bundle
command -v bundle > /dev/null 2>&1
)
then
true
else
if (
unset gem
command -v gem > /dev/null 2>&1
)
then
printf "The rubygem 'bundler' is not installed. Installing it now.\n"
gem install bundler
else
printf "Cannot use 'bundler' as 'gem' was not found in the path!.\n"
fi
fi
if (
unset bundle
command -v bundle > /dev/null 2>&1
)
then
printf "Bundling your gems. This may take a few minutes on first run.\n"
if [[ "$*" =~ *install* ]]
then
command bundle "$@" --binstubs
else
command bundle "$@"
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment