fix: add message if hjson is not found and mention hjson in README.md

closes #1
This commit is contained in:
CJ van den Berg 2024-08-05 20:12:44 +02:00
parent 4e83920d46
commit b53d024dfe
2 changed files with 14 additions and 1 deletions

View file

@ -1,2 +1,15 @@
# flow-themes # flow-themes
Themes compiler for Flow-Control, the text editor 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`.

View file

@ -959,7 +959,7 @@ fn hjson(data: []const u8) ![]const u8 {
if (bytesRead == 0) break; if (bytesRead == 0) break;
try writer.writeAll(buffer[0..bytesRead]); 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) { switch (term) {
std.process.Child.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(), std.process.Child.Term.Exited => |code| if (code == 0) return out.toOwnedSlice(),
else => {}, else => {},