Check GEM_HOME to compare recency
This commit is contained in:
parent
d2ce821cc8
commit
d3a6d8fbcc
12
src/_gem
12
src/_gem
|
|
@ -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 ))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue