From 27f49b9523ffa7d17c52b39fd5e14c277c7f628b Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 23 Oct 2025 18:40:13 +0200 Subject: [PATCH] __fish_macos_set_env: extract function to make it testable --- share/config.fish | 26 ----------------------- share/functions/__fish_macos_set_env.fish | 26 +++++++++++++++++++++++ tests/checks/__fish_macos_set_env.fish | 16 ++++++++++++++ 3 files changed, 42 insertions(+), 26 deletions(-) create mode 100644 share/functions/__fish_macos_set_env.fish create mode 100644 tests/checks/__fish_macos_set_env.fish diff --git a/share/config.fish b/share/config.fish index 893336f21..215a2dc33 100644 --- a/share/config.fish +++ b/share/config.fish @@ -158,32 +158,6 @@ and __fish_set_locale # if status --is-login if command -sq /usr/libexec/path_helper - # Adapt construct_path from the macOS /usr/libexec/path_helper - # executable for fish; see - # https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html . - function __fish_macos_set_env -d "set an environment variable like path_helper does (macOS only)" - set -l result - - # Populate path according to config files - for path_file in $argv[2] $argv[3]/* - for entry in (string split : etc/manpaths +mkdir etc/manpaths.d + +MANPATH=:/custom/man-path \ + __fish_macos_set_env MANPATH etc/manpaths etc/manpaths.d +string join \n entry=$MANPATH +# CHECK: entry=/usr/share/man +# CHECK: entry=/usr/local/share/man +# CHECK: entry= +# CHECK: entry=/Applications/Ghostty.app/Contents/Resources/ghostty/../man