Opt-In Wiki Generation
This commit is contained in:
@@ -45,14 +45,6 @@ func resolveReleasedPartsManifest(p *project.Project, progress func(string)) (ma
|
||||
if progress == nil {
|
||||
progress = func(string) {}
|
||||
}
|
||||
spec, err := deriveSowAssetsRepoSpec(p.Root)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
manifestURL, err := resolvePartsManifestAssetURL(spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cachePath := filepath.Join(p.Root, ".cache", "topdata", partsManifestCacheFileName)
|
||||
if strings.TrimSpace(os.Getenv("SOW_PARTS_MANIFEST_REFRESH")) == "" {
|
||||
manifest, fresh, err := readFreshPartsManifestCache(cachePath, partsManifestCacheMaxAge)
|
||||
@@ -63,6 +55,14 @@ func resolveReleasedPartsManifest(p *project.Project, progress func(string)) (ma
|
||||
return inventoryFromPartsManifest(manifest), nil
|
||||
}
|
||||
}
|
||||
spec, err := deriveSowAssetsRepoSpec(p.Root)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
manifestURL, err := resolvePartsManifestAssetURL(spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
progress(fmt.Sprintf("Fetching released parts manifest from %s...", manifestURL))
|
||||
manifest, err := fetchPartsManifest(manifestURL)
|
||||
if err != nil {
|
||||
@@ -220,6 +220,10 @@ func writePartsManifestCache(path string, manifest *partsManifest) error {
|
||||
payload = append(payload, '\n')
|
||||
current, err := os.ReadFile(path)
|
||||
if err == nil && bytes.Equal(current, payload) {
|
||||
now := time.Now()
|
||||
if err := os.Chtimes(path, now, now); err != nil {
|
||||
return fmt.Errorf("refresh parts manifest cache timestamp: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
|
||||
Reference in New Issue
Block a user