Created
April 24, 2015 23:06
-
-
Save jackjennings/c3476244d3e1056bcc1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| after_bundle do | |
| # Create the database and basic tables | |
| rake "db:create" | |
| rake "db:migrate" | |
| # Create the git repository | |
| git :init | |
| git add: '--all' | |
| git commit: "-m 'Initial commit'" | |
| # If hub is installed, try to create a new remote repository on GitHub | |
| if `which hub`.empty? | |
| puts "This template can create a github repository for you if you have `hub` installed" | |
| puts "https://hub.github.com" | |
| return | |
| end | |
| if yes?('Create a new GitHub repository? [yN]') | |
| name = ask_with_default("Name (name or organization/name):", @app_name) | |
| description = ask("Description:") | |
| flags = [] | |
| flags << "-d #{description}" unless description.blank? | |
| flags << '-p' unless no?("Make this repository private? [Yn]") | |
| run ['hub', 'create', *flags, name].join(' ') | |
| git push: 'origin master' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment