fix: set resources_dir on FreeBSD

This commit is contained in:
-k
2025-06-19 17:54:22 -04:00
committed by Mitchell Hashimoto
parent 8b0de9be4a
commit b32b1e7188

View File

@@ -55,11 +55,16 @@ pub fn resourcesDir(alloc: std.mem.Allocator) !?[]const u8 {
}
}
// On all platforms, we look for a /usr/share style path. This
// On all platforms (except BSD), we look for a /usr/share style path. This
// is valid even on Mac since there is nothing that requires
// Ghostty to be in an app bundle.
inline for (sentinels) |sentinel| {
if (try maybeDir(&dir_buf, dir, "share", sentinel)) |v| {
if (try maybeDir(
&dir_buf,
dir,
if (builtin.target.os.tag == .freebsd) "local/share" else "share",
sentinel,
)) |v| {
return try std.fs.path.join(alloc, &.{ v, "ghostty" });
}
}