Skip to content

Commit 7e4e5d3

Browse files
committed
Refactor Zig build scripts and your_sqlite3.sh
1 parent c466a38 commit 7e4e5d3

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

compiled_starters/zig/build.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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".

compiled_starters/zig/your_sqlite3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
#
77
# DON'T EDIT THIS!
88
set -e
9-
zig build-exe ./app/main.zig
10-
./main "$@"
9+
10+
exec zig build run -- "$@"

solutions/zig/01-dr6/code/build.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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".

solutions/zig/01-dr6/code/your_sqlite3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
#
77
# DON'T EDIT THIS!
88
set -e
9-
zig build-exe ./app/main.zig
10-
./main "$@"
9+
10+
exec zig build run -- "$@"

starter_templates/zig/build.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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".

starter_templates/zig/your_sqlite3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
#
77
# DON'T EDIT THIS!
88
set -e
9-
zig build-exe ./app/main.zig
10-
./main "$@"
9+
10+
exec zig build run -- "$@"

0 commit comments

Comments
 (0)