HanseltimeIndustries / template-repo-sync

A project for synchronizing template repositories with configured control on both sides of the repo.
0 stars 0 forks source link

Deleted/renamed files are not tracked when `updateAfterRef` is set to `false` #10

Open oprypkhantc opened 4 months ago

oprypkhantc commented 4 months ago

Hey!

If you set updateAfterRef to false, then it only globs for files present in the template repo: https://github.com/HanseltimeIndustries/template-repo-sync/blob/main/src/template-sync.ts#L102

This means that if a file is present in the target repository (one being synced), it'll not get picked up and won't show in the diff at all. I'd expect extra files to be deleted, unless they're in ignore config list.

hanseltime commented 2 months ago

@oprypkhantc - I chose to not do this type of behavior because a repo that is made from a template will fundamentally have 100s of more files than the template itself.

I'm open to a suggested interface change where we make it an explicit opt-in solution for something like deleteAllNewFiles. I could see that being valuable in a manual workflow call if someone is trying to see exactly what files are new (although, my current goal for this project is to target syncs that make dev's not ignore the sync because it's too big).

Please feel free to contribute a PR with the change.