about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-05-21 06:42:19 +0000
committerEric Wong <e@80x24.org>2015-05-21 07:16:19 +0000
commitbb197bbc8a19f885b08912909d3bfccf92249838 (patch)
tree7887997f48aceb381dda45bb61662b99a3191c3d
parent3bac94b99413f5ab5af684431b3155fffef042ad (diff)
downloaddtas-bb197bbc8a19f885b08912909d3bfccf92249838.tar.gz
No point in executing echo and wasting CPU cycles.  We'll only waste
cycles now during dry-runs
-rw-r--r--lib/dtas/splitfx.rb10
1 files changed, 3 insertions, 7 deletions
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