Fix Autogen Lockfile Overrides
This commit is contained in:
@@ -319,25 +319,13 @@ func newestAutogenInput(p *project.Project, now time.Time) (time.Time, string, e
|
||||
}
|
||||
|
||||
cachePath := filepath.Join(p.Root, ".cache", consumer.Manifest.CacheName)
|
||||
info, err := os.Stat(cachePath)
|
||||
candidateTime, candidatePath, err := newestReleasedAutogenManifestInput(p, consumer, now, cachePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if now.After(newest) {
|
||||
newest = now
|
||||
newestPath = cachePath
|
||||
}
|
||||
continue
|
||||
}
|
||||
return time.Time{}, "", fmt.Errorf("stat autogen manifest cache %s: %w", cachePath, err)
|
||||
}
|
||||
|
||||
candidateTime := info.ModTime()
|
||||
if autogenManifestCacheMaxAge > 0 && now.Sub(info.ModTime()) > autogenManifestCacheMaxAge {
|
||||
candidateTime = now
|
||||
return time.Time{}, "", err
|
||||
}
|
||||
if candidateTime.After(newest) {
|
||||
newest = candidateTime
|
||||
newestPath = cachePath
|
||||
newestPath = candidatePath
|
||||
}
|
||||
}
|
||||
return newest, newestPath, nil
|
||||
|
||||
Reference in New Issue
Block a user