fix: handle recursive config files

This commit is contained in:
Remi Gelinas
2024-07-17 17:27:31 -04:00
parent a546da0417
commit 0197f6d15e

View File

@ -42,17 +42,20 @@ pub fn run(alloc: std.mem.Allocator) !u8 {
const abs_path = try std.fs.cwd().realpath(config_path, &buf); const abs_path = try std.fs.cwd().realpath(config_path, &buf);
try cfg.loadFile(alloc, abs_path); try cfg.loadFile(alloc, abs_path);
try cfg.loadRecursiveFiles(alloc);
} else { } else {
try cfg.loadDefaultFiles(alloc); cfg = try Config.load(alloc);
} }
try cfg.finalize();
if (!cfg._errors.empty()) { if (!cfg._errors.empty()) {
for (cfg._errors.list.items) |err| { for (cfg._errors.list.items) |err| {
try stdout.print("{s}\n", .{err.message}); try stdout.print("{s}\n", .{err.message});
} }
return 1; return 65;
} }
return 1; return 0;
} }