We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
spawnProcessInline
1 parent c1ac864 commit 4764a53Copy full SHA for 4764a53
packages/mcl/src/src/mcl/utils/process.d
@@ -61,3 +61,19 @@ unittest
61
assert(execute(["true"]) == "");
62
// assertThrown(execute(["false"]), "Command `false` failed with status 1");
63
}
64
+
65
+void spawnProcessInline(string[] args)
66
+{
67
+ import std.logger : tracef;
68
+ import std.exception : enforce;
69
+ import std.process : spawnProcess, wait;
70
71
+ const bold = "\033[1m";
72
+ const normal = "\033[0m";
73
74
75
+ tracef("$ %s%-(%s %)%s", bold, args, normal);
76
77
+ auto pid = spawnProcess(args);
78
+ enforce(wait(pid) == 0, "Process failed.");
79
+}
0 commit comments