fix: Only run husky precommit hooks when relevant (#1274)

This commit is contained in:
Alex Hancock
2025-02-19 15:00:44 -05:00
committed by GitHub
parent 623f68a8fb
commit 537e1dcbeb

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
cd ui/desktop && npx lint-staged
# Only auto-format desktop TS code if relevant files are modified
if git diff --cached --name-only | grep -q "^ui/desktop/"; then
. "$(dirname -- "$0")/_/husky.sh"
cd ui/desktop && npx lint-staged
fi