From 834127f23e241826db132f51ea62fa307f57af56 Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Sun, 11 Sep 2022 22:36:38 +0200 Subject: [PATCH] create global cache path directory if it doesn't exist yet --- src/Config.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Config.zig b/src/Config.zig index 74d44c0..77ba0b2 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -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) {