Choose command separator for tasks based on OS.
authorWilliam D. Jones <thor0505@comcast.net>
Sat, 16 Mar 2019 03:14:12 +0000 (23:14 -0400)
committerWilliam D. Jones <thor0505@comcast.net>
Mon, 18 Mar 2019 03:01:24 +0000 (23:01 -0400)
Signed-off-by: William D. Jones <thor0505@comcast.net>
sbysrc/sby_core.py

index 7db60c81a4b4a5f32efd269a84b98bd3d6b35ece..608cca14dd8333f459fcf09287810c253c1e614c 100644 (file)
@@ -33,7 +33,19 @@ class SbyTask:
         self.job = job
         self.info = info
         self.deps = deps
-        self.cmdline = cmdline
+        if os.name == "posix":
+            self.cmdline = cmdline
+        else:
+            replacements = {
+                ";" : "&",
+                "{" : "(",
+                "}" : ")",
+            }
+
+            cmdline_copy = cmdline
+            for u, w in replacements.items():
+                cmdline_copy = cmdline_copy.replace(u, w)
+            self.cmdline = cmdline_copy
         self.logfile = logfile
         self.noprintregex = None
         self.notify = []