Compare commits

...

1 Commits

Author SHA1 Message Date
Alexandre Mouillard
2642b649ad chore: warn before committing dev routes in route-map.d.ts 2026-07-01 12:15:17 +02:00

View File

@@ -1,4 +1,21 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Check for dev routes in route-map.d.ts
ROUTE_MAP="@xen-orchestra/web/src/route-map.d.ts"
if git diff --cached --name-only | grep -qF "$ROUTE_MAP"; then
if git diff --cached -- "$ROUTE_MAP" | grep -qE "^\+.*(/dev/|src/pages/dev/)"; then
echo ""
echo "Warning: route-map.d.ts contains staged dev routes (/dev/*)."
echo "These are development-only routes and should not be committed."
printf "Commit anyway? [y/N] "
read REPLY </dev/tty
case "$REPLY" in
[yY][eE][sS]|[yY]) ;;
*) echo "Aborted. Use --no-verify to bypass this check."; exit 1 ;;
esac
echo ""
fi
fi
npx lint-staged