Try to create parent directory when writing default config (#4295)
Fixes https://github.com/ghostty-org/ghostty/issues/4277pull/4341/head
commit
94599102e9
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue