From b37c7240158cda5448c4581e5cb2b73dec33b358 Mon Sep 17 00:00:00 2001 From: Marcelo Cajueiro Date: Wed, 26 Aug 2020 15:30:23 -0300 Subject: [PATCH] Add config output_prefix This will add a prefix for every print allowing to know where the command is running where deploying in several servers. --- lib/mina/helpers/output.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/mina/helpers/output.rb b/lib/mina/helpers/output.rb index 708cf2dc..6538889c 100644 --- a/lib/mina/helpers/output.rb +++ b/lib/mina/helpers/output.rb @@ -15,31 +15,31 @@ def print_line(line) end def print_status(msg) - puts "#{color('----->', 32)} #{msg}" + puts "#{Configuration.instance.fetch(:output_prefix)}#{color('----->', 32)} #{msg}" end def print_error(msg) - puts " #{color('!', 33)} #{color(msg, 31)}" + puts "#{Configuration.instance.fetch(:output_prefix)} #{color('!', 33)} #{color(msg, 31)}" end def print_stderr(msg) if msg =~ /I, \[/ # fix for asset precompile print_stdout msg else - puts " #{color(msg, 31)}" + puts "#{Configuration.instance.fetch(:output_prefix)} #{color(msg, 31)}" end end def print_command(msg) - puts " #{color('$', 36)} #{color(msg, 36)}" + puts "#{Configuration.instance.fetch(:output_prefix)} #{color('$', 36)} #{color(msg, 36)}" end def print_info(msg) - puts " #{color(msg, 96)}" + puts "#{Configuration.instance.fetch(:output_prefix)} #{color(msg, 96)}" end def print_stdout(msg) - puts " #{msg}" + puts "#{Configuration.instance.fetch(:output_prefix)} #{msg}" end def color(str, c)