chore(dev): Ensure Flox activation in pre-commit hook for lint-staged (#41195)

Co-authored-by: Michael Matloka <dev@twixes.com>
This commit is contained in:
Julian Bez
2025-11-10 20:32:44 +01:00
committed by GitHub
parent a78de5074d
commit fbf6d2677d

View File

@@ -1,4 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
NODE_OPTIONS='--max-old-space-size=8192' pnpm lint-staged
# Activate Flox environment if available and not already active
# This ensures lint-staged commands work in GUI Git clients (GitHub Desktop, etc.)
if command -v flox &> /dev/null && [ -d ".flox/cache" ] && [ -z "$FLOX_ENV" ]; then
exec "$(command -v flox)" activate -- bash -c "NODE_OPTIONS='--max-old-space-size=8192' pnpm lint-staged"
else
# Fallback: run without Flox (for non-Flox users or if already activated)
NODE_OPTIONS='--max-old-space-size=8192' pnpm lint-staged
fi