]> code.delx.au - transcoding/commitdiff
batch-run chdir before running
authorJames Bunton <jamesbunton@delx.net.au>
Sat, 27 Jun 2015 08:16:48 +0000 (18:16 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sat, 27 Jun 2015 08:16:48 +0000 (18:16 +1000)
batch-run

index d62cec15c46217cc89d3d55dffe31cf9f58dd672..ab231afdf4e3d38781a9b33c4eab15de620f55e9 100755 (executable)
--- a/batch-run
+++ b/batch-run
@@ -67,11 +67,13 @@ def parse_args():
         help="The number of concurrent jobs to run")
     opts, args = parser.parse_args(sys.argv[1:])
     opts.running_jobs = []
+    args = map(os.path.abspath, args)
     return opts, args
 
 def main():
     opts, args = parse_args()
     for name in args:
+        os.chdir(os.path.dirname(name))
         batch_process(opts, parse_file(open(name)))
 
 if __name__ == "__main__":