20 lines
488 B
Bash
20 lines
488 B
Bash
#!/usr/bin/env sh
|
||
# pre-push hook:推送前编译检查
|
||
# Go 服务编译检查(go 不在 PATH 时跳过,CI 会做完整检查)
|
||
|
||
if ! command -v go >/dev/null 2>&1; then
|
||
echo "[pre-push] SKIP: go not in PATH, CI will verify"
|
||
exit 0
|
||
fi
|
||
|
||
for d in services/api-gateway services/push-gateway; do
|
||
if [ -d "$d" ]; then
|
||
(cd "$d" && go build ./... ) || {
|
||
echo "[pre-push] FAIL: $d go build failed"
|
||
exit 1
|
||
}
|
||
fi
|
||
done
|
||
|
||
echo "[pre-push] OK: Go build check passed"
|