fix: file creation when directory already exists

pull/8892/head
CoderJoshDK 2025-09-24 12:08:12 -04:00
parent f97518cc10
commit 315b54822a
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -3351,7 +3351,7 @@ pub fn loadOptionalFile(
fn writeConfigTemplate(path: []const u8) !void {
log.info("creating template config file: path={s}", .{path});
if (std.fs.path.dirname(path)) |dir_path| {
try std.fs.makeDirAbsolute(dir_path);
try std.fs.cwd().makePath(dir_path);
}
const file = try std.fs.createFileAbsolute(path, .{});
defer file.close();