Bug 1789687: Fix the replace-regex action for moz.yaml r=jewilde

We accidently passed True when we want a non-regex replacement.
This works for those, but not for the regex ones.

Differential Revision: https://phabricator.services.mozilla.com/D156715
This commit is contained in:
Tom Ritter 2022-09-07 19:18:33 +00:00
parent 226adb5a86
commit 32188211aa

View File

@ -45,7 +45,7 @@ def _replace_in_file(file, pattern, replacement, regex=False):
if newcontents == contents:
raise Exception(
"Could not find %s in %s to replace with %s" % (pattern, file, replacement)
"Could not find '%s' in %s to %sreplace with '%s'" % (pattern, file, "regex-" if regex else "", replacement)
)
with open(file, "w") as f:
@ -512,7 +512,7 @@ class VendorManifest(MozbuildObject):
file,
update["pattern"],
replacement,
regex=update["action"] == "replace-in-file",
regex=update["action"] == "replace-in-file-regex",
)
elif update["action"] == "delete-path":
path = self.get_full_path(update["path"])