From f90142d0ccb68fa542ef08a40162423e36928c48 Mon Sep 17 00:00:00 2001 From: Lee Cannon Date: Tue, 20 Sep 2022 19:52:24 +0100 Subject: [PATCH] create entire cache folder path --- src/Config.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Config.zig b/src/Config.zig index beb64bd..6707eda 100644 --- a/src/Config.zig +++ b/src/Config.zig @@ -203,7 +203,6 @@ pub fn configChanged(config: *Config, allocator: std.mem.Allocator, builtin_crea config.builtin_path = try std.fs.path.join(allocator, &.{ builtin_creation_dir.?, "builtin.zig" }); } - if (null == config.global_cache_path) { const cache_dir_path = (try known_folders.getPath(allocator, .cache)) orelse { logger.warn("Known-folders could not fetch the cache path", .{}); @@ -213,7 +212,7 @@ pub fn configChanged(config: *Config, allocator: std.mem.Allocator, builtin_crea 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) { + std.fs.cwd().makePath(config.global_cache_path.?) catch |err| switch (err) { error.PathAlreadyExists => {}, else => return err, }; @@ -227,5 +226,4 @@ pub fn configChanged(config: *Config, allocator: std.mem.Allocator, builtin_crea try file.writeAll(@embedFile("special/build_runner.zig")); } - }