on windows the env var for home seems to be HOMEPATH

This commit is contained in:
2024-09-20 15:29:30 +02:00
parent a60fadd248
commit ec75712d04

View File

@@ -266,7 +266,7 @@ fn configLocation(allocator: Allocator) ![]const u8 {
return config_location;
}
const home = std.process.getEnvVarOwned(allocator, "HOME") catch null;
const home = std.process.getEnvVarOwned(allocator, "HOME") catch std.process.getEnvVarOwned(allocator, "HOMEPATH") catch null;
const base = home orelse unreachable;
const config_location = try std.mem.concat(allocator, u8, &[_][]const u8{ base, "/.zig-totp" });