mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-11-28 12:00:08 +08:00
Check GEM_HOME to compare recency
This commit is contained in:
1 parent
d2ce821cc8
commit
d3a6d8fbcc
1 file changed
+11
-1
@@ -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