hu 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hu/deploy.rb +17 -5
- data/lib/hu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a3481b94745be691e1fc4f00dd65c648d084591
|
4
|
+
data.tar.gz: e04ccde7b6b9aab97db2c1e121db046c06e046e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9112e6e1b3b044ea865335987c1e4cd0234af0ecc116fbe2866fac9c37ac4676173347972ec665b641636f1cb56c0799f22fada3fd5c608eb5a794429e1376b2
|
7
|
+
data.tar.gz: cba66c9948857c833863937bc93550a7445c66bae5e571a867062920087062be238925261c0965918bc6e5e28cb511124327fdad4a32f4c6e8e7d0afbd81c131
|
data/lib/hu/deploy.rb
CHANGED
@@ -17,6 +17,7 @@ module Hu
|
|
17
17
|
class Cli < Optix::Cli
|
18
18
|
class Deploy < Optix::Cli
|
19
19
|
@@shutting_down = false
|
20
|
+
@@spinner = nil
|
20
21
|
|
21
22
|
text "Interactive deployment."
|
22
23
|
desc "Interactive deployment"
|
@@ -32,14 +33,25 @@ module Hu
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def deploy(cmd, opts, argv)
|
35
|
-
trap('INT') { shutdown; safe_abort }
|
36
|
+
trap('INT') { shutdown; safe_abort; exit 1 }
|
36
37
|
at_exit {
|
37
38
|
if 130 == $!.status
|
38
39
|
shutdown
|
39
40
|
puts
|
40
41
|
safe_abort
|
42
|
+
exit $!.status
|
41
43
|
end
|
42
44
|
}
|
45
|
+
|
46
|
+
unless File.exists? '.git'
|
47
|
+
puts
|
48
|
+
puts "You need to be inside the working directory of the app that you wish to deploy.".color(:red)
|
49
|
+
puts
|
50
|
+
safe_abort
|
51
|
+
print TTY::Cursor.prev_line
|
52
|
+
exit 1
|
53
|
+
end
|
54
|
+
|
43
55
|
push_url = get_heroku_git_remote
|
44
56
|
|
45
57
|
wc_update = Thread.new { update_working_copy }
|
@@ -151,8 +163,7 @@ module Hu
|
|
151
163
|
puts
|
152
164
|
anykey
|
153
165
|
when :abort_ask
|
154
|
-
delete_branch("release/#{release_tag}")
|
155
|
-
puts
|
166
|
+
puts if delete_branch("release/#{release_tag}")
|
156
167
|
exit 0
|
157
168
|
when :retag
|
158
169
|
if delete_branch("release/#{release_tag}")
|
@@ -449,6 +460,7 @@ module Hu
|
|
449
460
|
existing_branch = branches.find {|e| e.start_with? 'release/'}
|
450
461
|
branch_already_exists = !existing_branch.nil?
|
451
462
|
release_tag = existing_branch[8..-1] if keep_existing && branch_already_exists
|
463
|
+
|
452
464
|
if branch_already_exists && !keep_existing
|
453
465
|
choice = prompt.expand("The branch '"+"release/#{release_tag}".color(:red)+"' already exists. What shall we do?",
|
454
466
|
{default: 0}) do |q|
|
@@ -475,6 +487,7 @@ module Hu
|
|
475
487
|
release_tag = develop_tag
|
476
488
|
else
|
477
489
|
start_release(release_tag)
|
490
|
+
puts
|
478
491
|
end
|
479
492
|
end
|
480
493
|
|
@@ -566,7 +579,7 @@ module Hu
|
|
566
579
|
end
|
567
580
|
|
568
581
|
def safe_abort
|
569
|
-
@@spinner
|
582
|
+
@@spinner&.stop
|
570
583
|
printf "\e[0m\e[?25l"
|
571
584
|
printf '(ヘ・_・)ヘ┳━┳'
|
572
585
|
sleep 0.5
|
@@ -583,7 +596,6 @@ module Hu
|
|
583
596
|
printf "\e[17D "
|
584
597
|
printf "\e[?25h"
|
585
598
|
puts
|
586
|
-
exit 1
|
587
599
|
end
|
588
600
|
end
|
589
601
|
end
|
data/lib/hu/version.rb
CHANGED