fix fragile hak packing
build-binaries / build-binaries (pull_request) Successful in 2m5s
test-image / build-image (pull_request) Successful in 35s
test / test (pull_request) Successful in 1m20s

This commit is contained in:
2026-07-10 10:04:40 +02:00
parent 754375fb08
commit 968231d0c8
3 changed files with 80 additions and 18 deletions
+2 -14
View File
@@ -12,7 +12,6 @@ import (
"strconv"
"strings"
"git.westgate.pw/ShadowsOverWestgate/sow-tools/internal/erf"
"git.westgate.pw/ShadowsOverWestgate/sow-tools/internal/project"
)
@@ -2230,22 +2229,11 @@ func validateTopPackageAssets(sourceDir, dataDir string, report *ValidationRepor
if err != nil {
return err
}
if strings.HasPrefix(filepath.Base(path), ".") {
return nil
}
if strings.EqualFold(filepath.Ext(path), ".md") {
return nil // docs (AGENTS.md, README.md, ...) are never HAK resources
if skipTopPackageAsset(rel) {
return nil // not a NWN ResType (script, doc, _work dir, ...): never packed, never checked
}
base := strings.ToLower(strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)))
ext := strings.TrimPrefix(strings.ToLower(filepath.Ext(path)), ".")
if _, ok := erf.HAKResourceTypeForExtension(ext); !ok {
report.Diagnostics = append(report.Diagnostics, Diagnostic{
Severity: SeverityError,
Path: path,
Message: fmt.Sprintf("unsupported topdata asset HAK resource extension %q", filepath.Ext(path)),
})
return nil
}
key := base + "." + ext
if previous, ok := seen[key]; ok {
report.Diagnostics = append(report.Diagnostics, Diagnostic{