fix(version-sync,deploy): exclude untracked parent workspace.toml from --check failure and re-exec sync-vps-repos.sh on self-update (v2.0.17)
This commit is contained in:
1 parent
62592f2efd
commit
5841ccea2c
14 files changed
+33
-20
No files matched your search
@@ -56,10 +56,6 @@ def get_version_targets(ws_root: Path | None = None) -> list[tuple[Path, list[tu
|
||||
core / "workspace.example.toml",
|
||||
[(rf'schema_version\s*=\s*"{SEMVER_RE}"', 'schema_version = "{V}"')],
|
||||
),
|
||||
(
|
||||
cfg.workspace_root / "workspace.toml",
|
||||
[(rf'schema_version\s*=\s*"{SEMVER_RE}"', 'schema_version = "{V}"')],
|
||||
),
|
||||
(
|
||||
core / "site" / "index.html",
|
||||
[
|
||||
@@ -140,6 +136,7 @@ def sync_workspace_version(target_version: str, check_only: bool = False, ws_roo
|
||||
if not re.match(rf"^{SEMVER_RE}$", v):
|
||||
raise ValueError(f"Invalid semantic version '{target_version}' (expected X.Y.Z)")
|
||||
|
||||
cfg = load_workspace_config(workspace_root=ws_root)
|
||||
targets = get_version_targets(ws_root=ws_root)
|
||||
modified_files: list[str] = []
|
||||
mismatched_files: list[str] = []
|
||||
@@ -161,6 +158,15 @@ def sync_workspace_version(target_version: str, check_only: bool = False, ws_roo
|
||||
path.write_text(updated, encoding="utf-8")
|
||||
modified_files.append(str(path))
|
||||
|
||||
if not check_only:
|
||||
ws_toml = cfg.workspace_root / "workspace.toml"
|
||||
if ws_toml.is_file():
|
||||
orig_ws = ws_toml.read_text(encoding="utf-8")
|
||||
upd_ws = re.sub(rf'schema_version\s*=\s*"{SEMVER_RE}"', f'schema_version = "{v}"', orig_ws, flags=re.M)
|
||||
if upd_ws != orig_ws:
|
||||
ws_toml.write_text(upd_ws, encoding="utf-8")
|
||||
modified_files.append(str(ws_toml))
|
||||
|
||||
return {
|
||||
"target_version": v,
|
||||
"check_only": check_only,
|
||||
|
||||
Reference in new issue
Block a user