From bb197bbc8a19f885b08912909d3bfccf92249838 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 21 May 2015 06:42:19 +0000 Subject: splitfx: simplify output display No point in executing echo and wasting CPU cycles. We'll only waste cycles now during dry-runs --- lib/dtas/splitfx.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index e3dcf61..adc6c77 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -237,12 +237,8 @@ class DTAS::SplitFX # :nodoc: show_cmd = expand_cmd(env, command) end - echo = "echo #{xs(show_cmd)}" - if opts[:dryrun] - command = echo - else - system(echo) unless opts[:silent] - end + puts(show_cmd.join(' ')) unless opts[:silent] + command = 'true' if opts[:dryrun] # still gotta fork # pgroup: false so Ctrl-C on command-line will immediately stop everything [ dtas_spawn(env, command, pgroup: false), comments ] @@ -398,7 +394,7 @@ class DTAS::SplitFX # :nodoc: env["INBASE"] = xs(base) end - def expand_cmd(env, command) + def expand_cmd(env, command) # for display purposes only Shellwords.split(command).map do |arg| qx(env, "printf %s \"#{arg}\"") end -- cgit v1.2.3-24-ge0c7