create global cache path directory if it doesn't exist yet

This commit is contained in:
Techatrix 2022-09-11 22:36:38 +02:00
parent 75677f424c
commit 834127f23e

View File

@ -211,6 +211,11 @@ pub fn configChanged(config: *Config, allocator: std.mem.Allocator, builtin_crea
defer allocator.free(cache_dir_path);
config.global_cache_path = try std.fs.path.resolve(allocator, &[_][]const u8{ cache_dir_path, "zls" });
std.fs.makeDirAbsolute(config.global_cache_path.?) catch |err| switch(err) {
error.PathAlreadyExists => {},
else => return err,
};
}
if (null == config.build_runner_path) {