mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 06:24:01 +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 max_age 86400 # one day
|
||||||
set -l age $max_age
|
set -l age $max_age
|
||||||
|
|
||||||
if test -f $db
|
if test -f "$db"
|
||||||
set age (math (date +%s) - (stat -f %m $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
|
end
|
||||||
|
|
||||||
MANPATH="$cache" apropos $argv
|
MANPATH="$cache" apropos $argv
|
||||||
|
|
Loading…
Reference in a new issue