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

@ -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 => {},