fix(extract): keep committed palette skeletons out of stale cleanup (#96)
build-binaries / build-binaries (push) Successful in 2m50s
build-binaries / build-binaries (push) Successful in 2m50s
Extract skips writing *palcus.itp back to source (build projects them from blueprints, #50), but the skip branch never marked the skeleton target as desired, so cleanupStaleFiles deleted the committed source/palettes/*.itp.json on every extract — shipping modules with empty custom palettes. Fix marks the skipped target desired; regression test builds a module with a committed skeleton and asserts extract leaves it in place. 🤖 Generated with [Claude Code](https://claude.com/claude-code)Reviewed-on: #96 Co-authored-by: vickydotbat <vickydotbat@tutamail.com>
This commit was merged in pull request #96.
This commit is contained in:
@@ -126,8 +126,14 @@ func extractArchiveResources(p *project.Project, archive erf.Archive, desired ma
|
||||
}
|
||||
// *palcus.itp are Toolset-generated palette projections; the module
|
||||
// build regenerates them from source blueprints, so extraction never
|
||||
// writes them back into source.
|
||||
// writes them back into source. The committed skeleton still has to
|
||||
// survive stale cleanup, so mark its target as desired.
|
||||
if ext == "itp" && isPaletteProjectionResref(resource.Name) {
|
||||
effective := p.EffectiveConfig()
|
||||
target, err := extractionTarget(p, "paths.source", effective.Paths.Source, p.SourceDir(), sourceSubdir(ext), strings.ToLower(resource.Name)+"."+ext+".json")
|
||||
if err == nil {
|
||||
desired[target] = struct{}{}
|
||||
}
|
||||
skippedCount++
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user