forked from drnic/appscrolls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github.rb
34 lines (27 loc) · 882 Bytes
/
github.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
gem 'github', '>= 0.7.0', :require => nil, :group => [:development]
after_everything do
github_private = multiple_choice "Create a GitHub repository?", [["Public", false], ["Private", true]]
tried_create_already = false
while (@git_uri = `git config remote.origin.url`.strip) && @git_uri.size == 0
if tried_create_already
@repo_name = ask_wizard "Repository already exists. What project name?"
else
@repo_name = ""
end
if github_private
run "bundle exec gh create-from-local #{@repo_name} --private"
else
run "bundle exec gh create-from-local #{@repo_name}"
end
tried_create_already = true
end
say_custom "github", "Created repo #{@git_uri}"
end
__END__
name: GitHub
description: Push project to new GitHub repository
author: drnic
category: deployment
exclusive: scm-hosting
requires: [git]
run_after: [git]