Instead of modifying the source file in place, first copy it to a temp location with mktemp, then do all the modifications and copy to dest path as usual.
Currently it modifies the source files in place.
If multiple versions are to be created from the same source file, it will modify them multiple times, breaking files.
Tests performed
Tested with the temporary v-test-sync-files tag. By calling it from:
Description
Instead of modifying the source file in place, first copy it to a temp location with mktemp, then do all the modifications and copy to dest path as usual.
Currently it modifies the source files in place.
If multiple versions are to be created from the same source file, it will modify them multiple times, breaking files.
Tests performed
Tested with the temporary
v-test-sync-files
tag. By calling it from:Without this PR
With this PR
Effects on system behavior
Not applicable.
Interface changes
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.