From b53d024dfe63c39289e333f3a3be09cf43047bb5 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Mon, 5 Aug 2024 20:12:44 +0200 Subject: [PATCH] fix: add message if hjson is not found and mention hjson in README.md closes #1 --- README.md | 13 +++++++++++++ src/compile.zig | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb8235b..3c8d1f9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # flow-themes Themes compiler for Flow-Control, the text editor + +## Requirements + + - zig 0.13 + - hjson (installed in your PATH) + +## Build + +`zig build` + +This will download and compile all the themes and create a zig module +in `zig-out` that can be referenced as a dependency from another project's +`build.zig.zon`. diff --git a/src/compile.zig b/src/compile.zig index 733017c..466390e 100644 --- a/src/compile.zig +++ b/src/compile.zig @@ -959,7 +959,7 @@ fn hjson(data: []const u8) ![]const u8 { if (bytesRead == 0) break; try writer.writeAll(buffer[0..bytesRead]); } - const term = try child.wait(); + const term = child.wait() catch |e| std.debug.panic("error running hjson: {any}", .{e}); switch (term) { std.process.Child.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(), else => {},