Release v2.10.0: Wire hs-closeups-sync into pre-commit hooks, push-all-to-git-libre-audio.sh, and sync-vps-repos.sh across all 6 repositories
This commit is contained in:
1 parent
75e80f6a66
commit
cc73a57bd8
3 files changed
+8
-6
No files matched your search
@@ -534,14 +534,15 @@ def install_git_pre_commit_hooks(ws_root: Path | None = None, check_only: bool =
|
||||
hooks_dir = rdir / ".git" / "hooks"
|
||||
if not hooks_dir.is_dir():
|
||||
continue
|
||||
for h_name, h_script, marker in (
|
||||
("pre-commit", PRE_COMMIT_HOOK_SCRIPT, "readme_sync"),
|
||||
("commit-msg", COMMIT_MSG_HOOK_SCRIPT, "COMMIT-MSG GATE"),
|
||||
for h_name, h_script, markers in (
|
||||
("pre-commit", PRE_COMMIT_HOOK_SCRIPT, ("readme_sync", "closeups_sync")),
|
||||
("commit-msg", COMMIT_MSG_HOOK_SCRIPT, ("COMMIT-MSG GATE",)),
|
||||
):
|
||||
hook_path = hooks_dir / h_name
|
||||
rel_label = f"/workspace/{rdir.name}/.git/hooks/{h_name}"
|
||||
if check_only:
|
||||
if not (hook_path.is_file() and os.access(hook_path, os.X_OK) and marker in hook_path.read_text(encoding="utf-8")):
|
||||
txt_h = hook_path.read_text(encoding="utf-8") if hook_path.is_file() else ""
|
||||
if not (hook_path.is_file() and os.access(hook_path, os.X_OK) and all(m in txt_h for m in markers)):
|
||||
missing.append(rel_label)
|
||||
else:
|
||||
installed.append(rel_label)
|
||||
|
||||
Reference in new issue
Block a user