16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/tol/heroku.rb', line 16
def deploy
puts Rainbow("Deploying to Heroku").foreground(:green)
puts "Identifying git branch"
branch = `git rev-parse --abbrev-ref HEAD`.gsub("\n", "")
puts "Identified local branch #{Rainbow(branch).foreground(:green)}. Please confirm."
choose do ||
.prompt = "Continue?"
.choice "Yes" do
end
.choice "No" do
return
end
end
puts "Identifying Heroku application"
apps = list_of_applications
if apps.length == 0
puts Rainbow("No Heroku apps found").foreground(:red)
puts "Add your remotes to .git/config"
elsif apps.length == 1
deploy_to(apps[0], branch)
else
puts Rainbow("Multiple Heroku apps found").foreground(:green)
choose do ||
.prompt = "Where to deploy?"
apps.each do |app|
.choice app do
deploy_to(app, branch)
end
end
.choice "None"
end
end
end
|