mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
__fish_apropos: Use macOS' stat explicitly
Overrides the GNU tools some people use. Fixes #7390.
This commit is contained in:
parent
cc0e366037
commit
fb57ca8791
1 changed files with 6 additions and 3 deletions
|
@ -23,8 +23,11 @@ function __fish_apropos
|
|||
set -l max_age 86400 # one day
|
||||
set -l age $max_age
|
||||
|
||||
if test -f $db
|
||||
set age (math (date +%s) - (stat -f %m $db))
|
||||
if test -f "$db"
|
||||
# Some people use GNU tools on macOS, and GNU stat works differently.
|
||||
# However it's currently guaranteed that the macOS stat is in /usr/bin,
|
||||
# so we use that explicitly.
|
||||
set age (math (date +%s) - (/usr/bin/stat -f %m $db))
|
||||
end
|
||||
|
||||
MANPATH="$cache" apropos $argv
|
||||
|
@ -36,4 +39,4 @@ function __fish_apropos
|
|||
else
|
||||
apropos $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue