Skip to content

Commit 28ef0f0

Browse files
committed
build: correct update versions from git
1 parent c5199ee commit 28ef0f0

File tree

2 files changed

+8
-43
lines changed

2 files changed

+8
-43
lines changed

scripts/update_git_versions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ def replace_in_file(filename: Path, pattern: "re.Pattern[str]", to: str) -> None
2727

2828
def main() -> None:
2929
version = get_version()
30+
version_files = list(Path("packages").rglob("__version__.py"))
3031

31-
for f in ["src/robotcode/__version__.py"]:
32+
for f in [Path("robotcode/cli/__version__.py"), *version_files]:
3233
replace_in_file(
33-
Path(f),
34+
f,
3435
re.compile(r"""(^_*version_*\s*=\s*['"])([^'"]*)(['"])""", re.MULTILINE),
3536
rf"\g<1>{version or ''}\g<3>",
3637
)
3738

38-
for f in ["package.json"]:
39-
replace_in_file(
40-
Path(f),
41-
re.compile(r"""(\"version\"\s*:\s*['"])([0-9]+\.[0-9]+\.[0-9]+.*)(['"])""", re.MULTILINE),
42-
rf"\g<1>{version or ''}\g<3>",
43-
)
39+
replace_in_file(
40+
Path("package.json"),
41+
re.compile(r"""(\"version\"\s*:\s*['"])([0-9]+\.[0-9]+\.[0-9]+.*)(['"])""", re.MULTILINE),
42+
rf"\g<1>{version or ''}\g<3>",
43+
)
4444

4545

4646
if __name__ == "__main__":

scripts/update_versions.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)