#!/bin/sh
# Optional pre-push gate for orisys-app — not installed automatically.
#
#     git config core.hooksPath .githooks      # turn it on
#     git config --unset core.hooksPath        # turn it off
#
# It runs the full merge gate (tools/gate.ps1: lint on the changed files, the studio
# suite, the shared suite, ui_check.py) and blocks the push when the gate fails. The
# gate needs Windows: it renders real Qt widgets offscreen with the project's
# interpreter. See tools/gate.ps1 and docs/test-repair-plan.zh.md §4.
#
# Windows PowerShell is used rather than pwsh so the hook works on a machine that only
# has the one PowerShell every Windows installation carries.
set -e
cd "$(git rev-parse --show-toplevel)"
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File tools/gate.ps1 -Task pre-push
