mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-17 16:00:19 +00:00
Check GEM_HOME to compare recency
This commit is contained in:
@@ -509,8 +509,18 @@ _gem_which() {
|
||||
}
|
||||
|
||||
_gem_extensions_caching_policy() {
|
||||
if [[ -n $GEM_HOME ]]; then
|
||||
gem_home=$GEM_HOME
|
||||
else
|
||||
gem_home=$(_call_program commands ${words[1]} env gemdir)
|
||||
fi
|
||||
|
||||
# Rebuild if gems directory is more recent than cache.
|
||||
[[ $gem_home/gems -nt "$1" ]] && return 0
|
||||
|
||||
# Rebuild if cache is older than one week.
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nm+1) )
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user