Skip to content

DRY: 8 publish-res scripts are structurally identical (~800 lines) #406

@Christophe-Rogiers

Description

@Christophe-Rogiers

Description

Eight publish-res-*.ps1 scripts (~100 lines each) across four projects follow the exact same structure. Only 3 values differ between them:

  1. $resourcesFolder target directory
  2. $buildConfiguration (Debug vs Release)
  3. Destination filename

All 8 scripts contain identical step sequence, identical Copy-Item patterns, and an identical commented-out Infrastructure.pdb section.

Files:

  • src/Servy/publish-res-debug.ps1 + publish-res-release.ps1
  • src/Servy.Manager/publish-res-debug.ps1 + publish-res-release.ps1
  • src/Servy.CLI/publish-res-debug.ps1 + publish-res-release.ps1
  • src/Servy.Service/publish-res-debug.ps1 + publish-res-release.ps1

Estimated redundant lines: ~800

Suggested fix

Create a single publish-res.ps1 accepting -Configuration, -TargetResourcesFolder, and -DestinationName parameters.

Metadata

Metadata

Assignees

Labels

refactorChanges that improve structure, readability, or maintainability without altering external behavior

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions