fix: confgenfs source file

This commit is contained in:
LordMZTE 2024-06-21 23:30:44 +02:00
parent 624485b360
commit d2d1b47b51
Signed by untrusted user: LordMZTE
GPG key ID: B64802DC33A64FF6
3 changed files with 4 additions and 4 deletions

View file

@ -65,7 +65,7 @@ pub fn build(b: *std.Build) void {
if (confgenfs) {
const confgenfs_exe = b.addExecutable(.{
.name = "confgenfs",
.root_source_file = b.path("confgen/main.zig"),
.root_source_file = b.path("confgenfs/main.zig"),
.link_libc = true,
.target = target,
.optimize = optimize,

View file

@ -582,13 +582,13 @@ fn generateOptsJSON(self: *FileSystem) ![]const u8 {
fn eval(self: *FileSystem, code: []const u8) !void {
if (libcg.c.luaL_loadbuffer(self.l, code.ptr, code.len, "<cgfs-eval>") != 0) {
std.log.err("unable to load eval code: {s}", .{libcg.ffi.luaToString(self.l, -1)});
std.log.err("unable to load eval code: {?s}", .{libcg.ffi.luaToString(self.l, -1)});
libcg.c.lua_pop(self.l, 1);
return error.InvalidEvalCode;
}
if (libcg.c.lua_pcall(self.l, 0, 0, 0) != 0) {
std.log.err("unable to run eval code: {s}", .{libcg.ffi.luaToString(self.l, -1)});
std.log.err("unable to run eval code: {?s}", .{libcg.ffi.luaToString(self.l, -1)});
libcg.c.lua_pop(self.l, 1);
return error.InvalidEvalCode;
}

View file

@ -448,7 +448,7 @@ fn lDoTemplateFile(l: *c.lua_State) !c_int {
tmpl_code.name.ptr,
) != 0) {
// TODO: turn this into a lua error
std.log.err("loading template: {?s}", .{ffi.luaToString(l, -1)});
std.log.err("loading template: {?s}", .{ffi.luaConvertString(l, -1)});
return error.LoadTemplate;
}