summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig13
1 files changed, 6 insertions, 7 deletions
diff --git a/build.zig b/build.zig
index e65df7f..f468fb6 100644
--- a/build.zig
+++ b/build.zig
@@ -7,7 +7,7 @@ const Builder = std.build.Builder;
7pub fn build(b: *Builder) void { 7pub fn build(b: *Builder) void {
8 const mode = b.standardReleaseOptions(); 8 const mode = b.standardReleaseOptions();
9 9
10 const fmt_step = b.addFmt([_][]const u8{ 10 const fmt_step = b.addFmt(&[_][]const u8{
11 "build.zig", 11 "build.zig",
12 "clap", 12 "clap",
13 }); 13 });
@@ -41,7 +41,7 @@ pub fn build(b: *Builder) void {
41 example_step.dependOn(&example.step); 41 example_step.dependOn(&example.step);
42 } 42 }
43 43
44 const readme_step = b.step("test", "Remake README."); 44 const readme_step = b.step("readme", "Remake README.");
45 const readme = readMeStep(b); 45 const readme = readMeStep(b);
46 readme.dependOn(example_step); 46 readme.dependOn(example_step);
47 readme_step.dependOn(readme); 47 readme_step.dependOn(readme);
@@ -59,17 +59,16 @@ fn readMeStep(b: *Builder) *std.build.Step {
59 s.* = std.build.Step.init("ReadMeStep", b.allocator, struct { 59 s.* = std.build.Step.init("ReadMeStep", b.allocator, struct {
60 fn make(step: *std.build.Step) anyerror!void { 60 fn make(step: *std.build.Step) anyerror!void {
61 @setEvalBranchQuota(10000); 61 @setEvalBranchQuota(10000);
62 const file = try std.fs.File.openWrite("README.md"); 62 const file = try std.fs.cwd().createFile("README.md", .{});
63 const stream = &file.outStream().stream; 63 const stream = &file.outStream();
64 try stream.print( 64 try stream.print(@embedFile("example/README.md.template"), .{
65 @embedFile("example/README.md.template"),
66 @embedFile("example/simple.zig"), 65 @embedFile("example/simple.zig"),
67 @embedFile("example/simple-error.zig"), 66 @embedFile("example/simple-error.zig"),
68 @embedFile("example/comptime-clap.zig"), 67 @embedFile("example/comptime-clap.zig"),
69 @embedFile("example/streaming-clap.zig"), 68 @embedFile("example/streaming-clap.zig"),
70 @embedFile("example/help.zig"), 69 @embedFile("example/help.zig"),
71 @embedFile("example/usage.zig"), 70 @embedFile("example/usage.zig"),
72 ); 71 });
73 } 72 }
74 }.make); 73 }.make);
75 return s; 74 return s;