Fix bug.
This commit is contained in:
parent
21f9e32d0d
commit
51698a70d1
|
@ -264,16 +264,16 @@ namespace :exec_commands do
|
||||||
print data_str unless @no_stdout
|
print data_str unless @no_stdout
|
||||||
data_str.gsub!(/\r\n/, "\n")
|
data_str.gsub!(/\r\n/, "\n")
|
||||||
next if data_str.length == 0
|
next if data_str.length == 0
|
||||||
output_lines = data_str.split("\n")
|
output_lines = data_str.split("\n", -1)
|
||||||
first_output = output_lines[0]
|
first_output = output_lines[0]
|
||||||
if first_output
|
if first_output
|
||||||
if outputs.count != 0
|
if outputs.count != 0
|
||||||
outputs[-1] += first_output
|
outputs[-1] += first_output
|
||||||
# @remove_last_line = false
|
@remove_last_line = false
|
||||||
# outputs[-1] = outputs[-1].sub(/(.+)\r(.+)/) do |s|
|
outputs[-1] = outputs[-1].sub(/(.+)\r(.+)/) do |s|
|
||||||
# @remove_last_line = true
|
@remove_last_line = true
|
||||||
# first_output = $2
|
first_output = $2
|
||||||
# end
|
end
|
||||||
else
|
else
|
||||||
outputs << first_output
|
outputs << first_output
|
||||||
end
|
end
|
||||||
|
@ -285,9 +285,6 @@ namespace :exec_commands do
|
||||||
new_arr = output_lines[1..-1]
|
new_arr = output_lines[1..-1]
|
||||||
new_arr = new_arr.map do |output_line|
|
new_arr = new_arr.map do |output_line|
|
||||||
output_line = output_line.sub(/(.+)\r(.+)/, '\2')
|
output_line = output_line.sub(/(.+)\r(.+)/, '\2')
|
||||||
end.select{|s| s.present?}
|
|
||||||
if data_str[-1] == "\n"
|
|
||||||
new_arr << ""
|
|
||||||
end
|
end
|
||||||
outputs += new_arr
|
outputs += new_arr
|
||||||
if update_outputs
|
if update_outputs
|
||||||
|
|
Loading…
Reference in New Issue