From 5764e6be27bfb716193f974a08502363cf3d73e1 Mon Sep 17 00:00:00 2001 From: Bohung Date: Wed, 1 Dec 2021 21:11:18 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/exec_command.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/exec_command.rake b/lib/tasks/exec_command.rake index 6bc8b9d..e603bd5 100644 --- a/lib/tasks/exec_command.rake +++ b/lib/tasks/exec_command.rake @@ -169,10 +169,11 @@ namespace :exec_commands do data_str = data.to_s if data.include?("\n") || outputs.empty? output_lines = data_str.split("\n") - first_output = nil + first_output = output_lines[0] if outputs.count != 0 - first_output = output_lines[0] outputs[-1] += first_output + else + outputs << first_output end new_arr = output_lines[1..-1] if data_str[-1] == "\n"