makit 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/makit/command_runner.rb +26 -9
- data/lib/makit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3b0bd628ce6938847e0c743475a4470310984241499f201f575283bfe59c8ec
|
4
|
+
data.tar.gz: beddf5e7aa6b289da3529ff7206d00fe182f9b9d8aa6131e2bf8945894f4c4f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a5427cb8a91b71f971139a831f0acc3ffcd8f8f82c73651e1b57562cd2392fa4a2ef69fbb7376f027855b40080e2b18b728b09ee754d3c2164d78f264c89111
|
7
|
+
data.tar.gz: efe201b5a68a095140b3f34ca5f8e16087439f3841963c25b805ce6623bf7cd424154c4c3a3d087045130324516bddf0161ce0a4dc9fc56574455f6925918913
|
data/lib/makit/command_runner.rb
CHANGED
@@ -52,7 +52,9 @@ module Makit
|
|
52
52
|
#puts "cache file date: #{File.mtime(cache_filename)}"
|
53
53
|
if (File.mtime(cache_filename) > timestamp)
|
54
54
|
#puts "cache_filename exists and is newer than #{timestamp}"
|
55
|
-
|
55
|
+
command = Makit::Serializer.open(cache_filename, Makit::V1::Command)
|
56
|
+
show_command(command)
|
57
|
+
return command #Makit::Serializer.open(cache_filename, Makit::V1::Command)
|
56
58
|
else
|
57
59
|
#puts "cache_filename exists, but is older than #{timestamp}"
|
58
60
|
end
|
@@ -67,14 +69,7 @@ module Makit
|
|
67
69
|
command
|
68
70
|
end
|
69
71
|
|
70
|
-
|
71
|
-
def run(command_request)
|
72
|
-
raise "Invalid command_request" unless command_request.is_a? Makit::V1::CommandRequest
|
73
|
-
command = execute(command_request)
|
74
|
-
show_output = true
|
75
|
-
exit_on_error = true
|
76
|
-
|
77
|
-
log_to_artifacts(command) if @log_to_artifacts
|
72
|
+
def show_command(command)
|
78
73
|
if command.exit_code != 0
|
79
74
|
puts Makit::CommandRunner.get_command_summary(command) + " (exit code #{command.exit_code})".colorize(:default)
|
80
75
|
puts " directory: #{command.directory}\n"
|
@@ -86,6 +81,28 @@ module Makit
|
|
86
81
|
puts Makit::CommandRunner.get_command_summary(command) + " (#{command.duration.seconds} seconds)".colorize(:cyan)
|
87
82
|
puts Makit::Humanize::indent_string(command.output, 2).colorize(:default) if show_output_on_success
|
88
83
|
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Run a command and return a Makit::V1::Command.
|
87
|
+
def run(command_request)
|
88
|
+
raise "Invalid command_request" unless command_request.is_a? Makit::V1::CommandRequest
|
89
|
+
command = execute(command_request)
|
90
|
+
show_output = true
|
91
|
+
exit_on_error = true
|
92
|
+
|
93
|
+
log_to_artifacts(command) if @log_to_artifacts
|
94
|
+
show_command(command)
|
95
|
+
#if command.exit_code != 0
|
96
|
+
# puts Makit::CommandRunner.get_command_summary(command) + " (exit code #{command.exit_code})".colorize(:default)
|
97
|
+
# puts " directory: #{command.directory}\n"
|
98
|
+
# puts " duration: #{command.duration.seconds} seconds\n"
|
99
|
+
# puts Makit::Humanize::indent_string(command.output, 2) if command.output.length > 0
|
100
|
+
# puts Makit::Humanize::indent_string(command.error, 2) if command.error.length > 0
|
101
|
+
# exit 1 if command_request.exit_on_error
|
102
|
+
#else
|
103
|
+
# puts Makit::CommandRunner.get_command_summary(command) + " (#{command.duration.seconds} seconds)".colorize(:cyan)
|
104
|
+
# puts Makit::Humanize::indent_string(command.output, 2).colorize(:default) if show_output_on_success
|
105
|
+
#end
|
89
106
|
|
90
107
|
commands.push(command)
|
91
108
|
command
|
data/lib/makit/version.rb
CHANGED