Check that the zg std library path provided is absolute, default to null otherwise

This commit is contained in:
Alexandros Naskos 2020-05-15 13:21:34 +03:00
parent 9fc7d1f66e
commit 18a0ffc7e2

View File

@ -634,7 +634,12 @@ pub fn main() anyerror!void {
}
defer std.json.parseFree(Config, config, config_parse_options);
// @TODO Check is_absolute
if (config.zig_lib_path != null and !std.fs.path.isAbsolute(config.zig_lib_path.?)) {
std.debug.warn("zig library path is not absolute, defaulting to null.\n", .{});
allocator.free(config.zig_lib_path.?);
config.zig_lib_path = null;
}
try document_store.init(allocator, config.zig_lib_path);
defer document_store.deinit();