kdeploy 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 361d3e4177d88e983400481dbfcbd8ae4c3e6e4f7964e547cdfb9fbdf333ba6c
4
- data.tar.gz: d9c0aa6de6a5741f15cc175dffdc247903b4070fbd3ccfe66bb39bdcf8d52181
3
+ metadata.gz: 0203e26e85d3910ae62da516f229355cc3c19f360f2dd56abfda06e616195258
4
+ data.tar.gz: 20ab1369c1b7906d6fbe51191c7b999e617e65f1572014ada58eb12f52f5b143
5
5
  SHA512:
6
- metadata.gz: b24732771d9e0cbee179aeffcc83b2c3f99a9711c4730b00b33a7a7536ac5cf362dbf8462940c91a0314c4bb7b2547880c04dd402e6b2eba36ca355aa7973657
7
- data.tar.gz: b64dcf2f6498fd6b5f6d53c1738dbe719be7d033925e8e0b046bd5a6be5d2d93915e87ac4860079bb356d080b1e4170ec5398f10309dc0e2733c2a40147a3f46
6
+ metadata.gz: 912c3c3eb78ac13a8294f1e1468875bbc45a375701e6312054a51afb37e986eb7bb85061efe16f44a2ed48e2421235b47eedb2f9db6aee8616640e314610bb8c
7
+ data.tar.gz: 2e502450ba52305c98b294fd0bde975f494d066e9720bcbd504f13b61a9cc6d21930f0b510874e2e18bc27bb637c6d092401a1e13f9f18503e10febe0b2caa69
data/lib/kdeploy/cli.rb CHANGED
@@ -230,13 +230,12 @@ module Kdeploy
230
230
  changed_str = pastel.yellow("changed=#{changed.to_s.ljust(3)}")
231
231
  failed_str = pastel.red("failed=#{failed.to_s.ljust(3)}")
232
232
  line = "#{host.ljust(max_host_len)} : #{ok_str} #{changed_str} #{failed_str}"
233
- case result[:status]
234
- when :success
233
+ if failed.positive?
234
+ puts pastel.red(line)
235
+ elsif ok.positive? && failed.zero?
235
236
  puts pastel.green(line)
236
- when :changed
237
- puts pastel.yellow(line)
238
237
  else
239
- puts pastel.red(line)
238
+ puts line
240
239
  end
241
240
  end
242
241
  end
@@ -24,12 +24,10 @@ module Kdeploy
24
24
  raise "Could not execute command: #{command}" unless success
25
25
 
26
26
  channel.on_data do |_ch, data|
27
- print data # 实时输出
28
27
  stdout << data
29
28
  end
30
29
 
31
30
  channel.on_extended_data do |_ch, _type, data|
32
- print data # 实时输出
33
31
  stderr << data
34
32
  end
35
33
  end
@@ -50,6 +50,13 @@ module Kdeploy
50
50
  puts pastel.cyan(" [run] #{command[:command].lines.first.strip}")
51
51
  command[:command].lines[1..].each { |line| puts " > #{line.strip}" unless line.strip.empty? }
52
52
  output = executor.execute(command[:command])
53
+ # 统一输出命令结果
54
+ if output[:stdout] && !output[:stdout].empty?
55
+ output[:stdout].each_line { |line| puts " #{line.rstrip}" unless line.strip.empty? }
56
+ end
57
+ if output[:stderr] && !output[:stderr].empty?
58
+ output[:stderr].each_line { |line| puts pastel.red(" #{line.rstrip}") unless line.strip.empty? }
59
+ end
53
60
  result[:output] << { command: command[:command], output: output }
54
61
  when :upload
55
62
  pastel = Pastel.new
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdeploy
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdeploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kk