mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Merge pull request #1226 from mitchellh/boehs/1213
Fix #1213 (create dir if needed for settings)
This commit is contained in:
@ -9,6 +9,11 @@ pub fn open(alloc_gpa: Allocator) !void {
|
|||||||
const config_path = try internal_os.xdg.config(alloc_gpa, .{ .subdir = "ghostty/config" });
|
const config_path = try internal_os.xdg.config(alloc_gpa, .{ .subdir = "ghostty/config" });
|
||||||
defer alloc_gpa.free(config_path);
|
defer alloc_gpa.free(config_path);
|
||||||
|
|
||||||
|
// Create config directory recursively.
|
||||||
|
if (std.fs.path.dirname(config_path)) |config_dir| {
|
||||||
|
try std.fs.cwd().makePath(config_dir);
|
||||||
|
}
|
||||||
|
|
||||||
// Try to create file and go on if it already exists
|
// Try to create file and go on if it already exists
|
||||||
_ = std.fs.createFileAbsolute(
|
_ = std.fs.createFileAbsolute(
|
||||||
config_path,
|
config_path,
|
||||||
|
Reference in New Issue
Block a user