Fix updating of MODULE.bazel in update_bazel_workspace.py (#1550)
The regex was not matching which caused #1549 to fail.
This commit is contained in:
@@ -64,10 +64,11 @@ def update_module_version(version):
|
|||||||
with open(BAZEL_MODULE_FILE, 'r') as f:
|
with open(BAZEL_MODULE_FILE, 'r') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
||||||
content = re.sub(
|
pattern = '(module\(\s*name = "emsdk",\s*version = )"\d+.\d+.\d+",\n\)'
|
||||||
r'module\(name = "emsdk", version = "\d+.\d+.\d+"\)',
|
# Verify that the pattern exists in the input since re.sub will
|
||||||
f'module(name = "emsdk", version = "{version}")',
|
# will succeed either way.
|
||||||
content)
|
assert re.search(pattern, content)
|
||||||
|
content = re.sub(pattern, fr'\1"{version}",\n)', content)
|
||||||
|
|
||||||
with open(BAZEL_MODULE_FILE, 'w') as f:
|
with open(BAZEL_MODULE_FILE, 'w') as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|||||||
Reference in New Issue
Block a user