mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Try to create parent directory when writing default config (#4295)
Fixes https://github.com/ghostty-org/ghostty/issues/4277
This commit is contained in:
@ -2695,6 +2695,9 @@ pub fn loadOptionalFile(
|
|||||||
|
|
||||||
fn writeConfigTemplate(path: []const u8) !void {
|
fn writeConfigTemplate(path: []const u8) !void {
|
||||||
log.info("creating template config file: path={s}", .{path});
|
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, .{});
|
const file = try std.fs.createFileAbsolute(path, .{});
|
||||||
defer file.close();
|
defer file.close();
|
||||||
try std.fmt.format(
|
try std.fmt.format(
|
||||||
|
Reference in New Issue
Block a user