Fix Wiki Generation Not Running
This commit is contained in:
@@ -136,7 +136,7 @@ func buildWiki(p *project.Project, nativeResult BuildResult, force bool, progres
|
||||
}
|
||||
|
||||
state, _ := loadWikiState(statePath)
|
||||
if !force && digest != "" && state.Digest == digest {
|
||||
if !force && digest != "" && state.Digest == digest && wikiCachedPagesAreCurrent(outputDir, state) {
|
||||
return wikiResult{
|
||||
OutputDir: outputDir,
|
||||
PageCount: state.Pages,
|
||||
@@ -248,6 +248,23 @@ func buildWiki(p *project.Project, nativeResult BuildResult, force bool, progres
|
||||
}, nil
|
||||
}
|
||||
|
||||
func wikiCachedPagesAreCurrent(outputDir string, state wikiStateDocument) bool {
|
||||
if state.Pages <= 0 {
|
||||
return false
|
||||
}
|
||||
count := 0
|
||||
err := filepath.WalkDir(outputDir, func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !d.IsDir() && strings.EqualFold(filepath.Ext(path), ".html") {
|
||||
count++
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return err == nil && count == state.Pages
|
||||
}
|
||||
|
||||
func loadWikiManualSections(p *project.Project) []wikiManualSection {
|
||||
defaults := defaultWikiManualSections()
|
||||
cfg := p.EffectiveConfig().TopData.Wiki
|
||||
|
||||
Reference in New Issue
Block a user