File tree Expand file tree Collapse file tree 6 files changed +18
-6
lines changed
solutions/zig/01-dr6/code Expand file tree Collapse file tree 6 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ pub fn build(b: *std.Build) void {
1919 // such a dependency.
2020 const run_cmd = b .addRunArtifact (exe );
2121
22+ if (b .args ) | args | {
23+ run_cmd .addArgs (args );
24+ }
25+
2226 // This creates a build step. It will be visible in the `zig build --help` menu,
2327 // and can be selected like this: `zig build run`
2428 // This will evaluate the `run` step rather than the default, which is "install".
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88set -e
9- zig build-exe ./app/main.zig
10- ./main " $@ "
9+
10+ exec zig build run -- " $@ "
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ pub fn build(b: *std.Build) void {
1919 // such a dependency.
2020 const run_cmd = b .addRunArtifact (exe );
2121
22+ if (b .args ) | args | {
23+ run_cmd .addArgs (args );
24+ }
25+
2226 // This creates a build step. It will be visible in the `zig build --help` menu,
2327 // and can be selected like this: `zig build run`
2428 // This will evaluate the `run` step rather than the default, which is "install".
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88set -e
9- zig build-exe ./app/main.zig
10- ./main " $@ "
9+
10+ exec zig build run -- " $@ "
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ pub fn build(b: *std.Build) void {
1919 // such a dependency.
2020 const run_cmd = b .addRunArtifact (exe );
2121
22+ if (b .args ) | args | {
23+ run_cmd .addArgs (args );
24+ }
25+
2226 // This creates a build step. It will be visible in the `zig build --help` menu,
2327 // and can be selected like this: `zig build run`
2428 // This will evaluate the `run` step rather than the default, which is "install".
Original file line number Diff line number Diff line change 66#
77# DON'T EDIT THIS!
88set -e
9- zig build-exe ./app/main.zig
10- ./main " $@ "
9+
10+ exec zig build run -- " $@ "
You can’t perform that action at this time.
0 commit comments