generated from canonical/template-operator
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPE-5677] Fix the append scenarios in replace() (#484)
Update the `replace()` method to (1) be more "greedy" when searching for matches in the text, including multi-line matches; and (2) fix the write back to the file. Currently, it is possible that, if we have a smaller size than the original file size, we will end up writing: <new content><left over bytes> -> and this file still has the same size as it original. This PR simplifies the logic to decide how to write the changed content. Closes #483
- Loading branch information
1 parent
c039273
commit 4181669
Showing
2 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters