Prepare optional spell catalog inputs

This commit is contained in:
2026-08-29 15:03:44 +00:00
parent 5831c0c9e6
commit b3363f87d6
7 changed files with 369 additions and 8 deletions

View File

@@ -53,23 +53,28 @@ type effectiveLocksCheck struct {
func inspectStableInputs(cfg *config.Config) []stableInputCheck {
items := []struct {
name string
in config.ResolvedInputFile
name string
in config.ResolvedInputFile
optional bool
}{
{name: "speakers", in: cfg.StableInputs.SpeakersFile},
{name: "autocorrect", in: cfg.StableInputs.AutocorrectFile},
{name: "glossary", in: cfg.StableInputs.GlossaryFile},
{name: "players", in: cfg.StableInputs.PlayersFile},
{name: "party", in: cfg.StableInputs.PartyFile},
{name: "spell_catalog", in: cfg.StableInputs.SpellCatalogFile, optional: true},
}
out := make([]stableInputCheck, 0, len(items))
for _, item := range items {
if item.optional && strings.TrimSpace(item.in.Path) == "" {
continue
}
path, err := resolveHelperConfigRelativePath(item.in)
if err != nil {
out = append(out, stableInputCheck{Name: item.name, Err: err})
continue
}
if _, err := os.Stat(path); err != nil {
if err := requireInspectionFile(path, item.name); err != nil {
out = append(out, stableInputCheck{Name: item.name, Path: path, Err: err})
continue
}