| ... | ... | @@ -37,6 +37,9 @@ stdin_behavior: std.ChildProcess.StdIo = .Inherit, |
| 37 | 37 | |
| 38 | 38 | expected_exit_code: u8 = 0, |
| 39 | 39 | |
| 40 | /// Print the command before running it |
| 41 | print: bool, |
| 42 | |
| 40 | 43 | pub const StdIoAction = union(enum) { |
| 41 | 44 | inherit, |
| 42 | 45 | ignore, |
| ... | ... | @@ -58,6 +61,7 @@ pub fn create(builder: *Builder, name: []const u8) *RunStep { |
| 58 | 61 | .argv = ArrayList(Arg).init(builder.allocator), |
| 59 | 62 | .cwd = null, |
| 60 | 63 | .env_map = null, |
| 64 | .print = builder.verbose, |
| 61 | 65 | }; |
| 62 | 66 | return self; |
| 63 | 67 | } |
| ... | ... | @@ -181,6 +185,9 @@ fn make(step: *Step) !void { |
| 181 | 185 | child.stdout_behavior = stdIoActionToBehavior(self.stdout_action); |
| 182 | 186 | child.stderr_behavior = stdIoActionToBehavior(self.stderr_action); |
| 183 | 187 | |
| 188 | if (self.print) |
| 189 | printCmd(cwd, argv); |
| 190 | |
| 184 | 191 | child.spawn() catch |err| { |
| 185 | 192 | warn("Unable to spawn {s}: {s}\n", .{ argv[0], @errorName(err) }); |
| 186 | 193 | return err; |