From 537e1dcbeb047266bd64c82b6fa5d1e8e75087a2 Mon Sep 17 00:00:00 2001 From: Alex Hancock Date: Wed, 19 Feb 2025 15:00:44 -0500 Subject: [PATCH] fix: Only run husky precommit hooks when relevant (#1274) --- .husky/pre-commit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 3d471b4e..b7dc5230 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,7 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" -cd ui/desktop && npx lint-staged \ No newline at end of file +# 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 \ No newline at end of file