Update PRE_COMMIT_HOOK_SCRIPT in readme_sync.py to use virtualenv PYTHON_BIN (resolving Pillow ModuleNotFoundError during git commit hooks on VPS)

This commit is contained in:
Hermes Agent committed 2026-12-02 11:40:30 +00:00
1 parent cb146c38e7
commit 576ac40f25
2 files changed
+13 -6

No files matched your search

@@ -502,19 +502,26 @@ REPO_NAME="$(basename "${REPO_ROOT}")"
WS_ROOT="$(cd "${REPO_ROOT}/.." && pwd)"
CORE_SRC="${WS_ROOT}/hyperstitionstudio-core/src"
PYTHON_BIN="python3"
if [[ -x "${WS_ROOT}/.venv/bin/python3" ]]; then
PYTHON_BIN="${WS_ROOT}/.venv/bin/python3"
elif [[ -x "${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3" ]]; then
PYTHON_BIN="${WS_ROOT}/hyperstitionstudio-core/.venv/bin/python3"
fi
if [[ -d "${CORE_SRC}" ]]; then
export PYTHONPATH="${CORE_SRC}${PYTHONPATH:+:${PYTHONPATH}}"
if [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then
python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}" --stage
else
python3 -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}"
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.deploy_scripts_sync --workspace-root "${WS_ROOT}"
fi
python3 -m hyperstitionstud_io.publishing.closeups_sync
"${PYTHON_BIN}" -m hyperstitionstud_io.publishing.closeups_sync
if [[ -d "${WS_ROOT}/hyperstitionstudio-core/site/assets/closeups" ]] && [[ "${REPO_NAME}" == "hyperstitionstudio-core" ]]; then
git -C "${REPO_ROOT}" add site/assets/closeups/
fi
python3 -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage
python3 -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}"
"${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --repo "${REPO_NAME}" --stage
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.shorthand_lint --staged-diff --repo "${REPO_ROOT}"
fi
"""