From cdf51b1304388c869440ce3be4b1977ed04f057e Mon Sep 17 00:00:00 2001 From: Maciej Bartczak <39600846+maciekbartczak@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:28:26 +0100 Subject: [PATCH] Try to create parent directory when writing default config --- src/config/Config.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config/Config.zig b/src/config/Config.zig index 91c07cc787..35593f3f33 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -2695,6 +2695,9 @@ 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); + } const file = try std.fs.createFileAbsolute(path, .{}); defer file.close(); try std.fmt.format(