This commit is contained in:
BoHung Chiu 2021-12-01 21:11:18 +08:00
parent 647a57b5f4
commit 5764e6be27
1 changed files with 3 additions and 2 deletions

View File

@ -169,10 +169,11 @@ namespace :exec_commands do
data_str = data.to_s data_str = data.to_s
if data.include?("\n") || outputs.empty? if data.include?("\n") || outputs.empty?
output_lines = data_str.split("\n") output_lines = data_str.split("\n")
first_output = nil first_output = output_lines[0]
if outputs.count != 0 if outputs.count != 0
first_output = output_lines[0]
outputs[-1] += first_output outputs[-1] += first_output
else
outputs << first_output
end end
new_arr = output_lines[1..-1] new_arr = output_lines[1..-1]
if data_str[-1] == "\n" if data_str[-1] == "\n"