about summary refs log tree commit
path: root/lib/dtas/splitfx.rb
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-09 20:12:22 +0000
committerEric Wong <e@yhbt.net>2020-04-20 10:04:02 +0000
commit974854f21a1787a62b4cf8d7716c65f3712819df (patch)
tree63e81b7cd5fe7500f2f49f49595252939f0d6d6c /lib/dtas/splitfx.rb
parent65339db1168b36cb3ac262eef52f06183dd92ff5 (diff)
downloaddtas-974854f21a1787a62b4cf8d7716c65f3712819df.tar.gz
Write the contents of "stderr".  This is useful for capturing the
per-track output of the sox(1) "stats" effect when combined with
parallel "--jobs".
Diffstat (limited to 'lib/dtas/splitfx.rb')
-rw-r--r--lib/dtas/splitfx.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb
index 384df0f..58c8ff4 100644
--- a/lib/dtas/splitfx.rb
+++ b/lib/dtas/splitfx.rb
@@ -250,7 +250,10 @@ class DTAS::SplitFX # :nodoc:
     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 ]
+    o = { pgroup: false }
+    e = opts[:err_suffix] and
+      o[:err] = [ "#{env['OUTDIR']}#{env['TRACKNUMBER']}#{e}", 'a' ]
+    [ dtas_spawn(env, command, o), comments ]
   end
 
   def load_tracks!(hash)