From 4d2c98afeae93219aefb5ad2847692e0b58ac8b7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 3 Jul 2024 09:28:50 -0700 Subject: [PATCH] termio: allow failing to build manpath string --- src/termio/Exec.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index fab56576b..aeff1f0dd 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -992,9 +992,12 @@ const Subprocess = struct { // Add the man pages from our application bundle to MANPATH. if (comptime builtin.target.isDarwin()) { - if (opts.resources_dir) |resources_dir| { + if (opts.resources_dir) |resources_dir| man: { var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; - const dir = try std.fmt.bufPrint(&buf, "{s}/../man", .{resources_dir}); + const dir = std.fmt.bufPrint(&buf, "{s}/../man", .{resources_dir}) catch |err| { + log.warn("error building manpath, man pages may not be available err={}", .{err}); + break :man; + }; if (env.get("MANPATH")) |manpath| { // Append to the existing MANPATH. It's very unlikely that our bundle's