From b27409fa3fbb63675845b035f69bcf6f6201f4a7 Mon Sep 17 00:00:00 2001 From: Bohung Date: Tue, 4 Jan 2022 10:23:28 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/exec_command.rake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/tasks/exec_command.rake b/lib/tasks/exec_command.rake index 0d7868d..e1fe780 100644 --- a/lib/tasks/exec_command.rake +++ b/lib/tasks/exec_command.rake @@ -197,10 +197,12 @@ namespace :exec_commands do if data.include?("\n") || outputs.empty? output_lines = data_str.split("\n") first_output = output_lines[0] - if outputs.count != 0 - outputs[-1] += first_output - else - outputs << first_output + if first_output + if outputs.count != 0 + outputs[-1] += first_output + else + outputs << first_output + end end new_arr = output_lines[1..-1] if data_str[-1] == "\n"