Skip to content

Commit 90a5af9

Browse files
ve-ntRufus Segar
authored and
Rufus Segar
committed
Use APPDATA directory for zon file on Windows
1 parent f4addd7 commit 90a5af9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

zigup.zig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,17 @@ const Config = struct {
488488
}
489489

490490
fn defaultZonPath(allocator: Allocator) ![]const u8 {
491+
const zon_fname = "zigup.zon";
491492
return switch (builtin.os.tag) {
492-
.linux => std.fs.path.join(allocator, &[_][]const u8{ try getHomeDir(), ".config/zigup.zon" }),
493-
else => @compileError("Not supported yet"), // TODO: Complete list
493+
.windows => std.fs.path.join(allocator, &[_][]const u8{
494+
try std.fs.getAppDataDir(allocator, "zigup"),
495+
zon_fname,
496+
}),
497+
else => std.fs.path.join(allocator, &[_][]const u8{
498+
try getHomeDir(),
499+
".config",
500+
zon_fname,
501+
}),
494502
};
495503
}
496504

0 commit comments

Comments
 (0)