Skip to content

Commit

Permalink
perf(husky): do not run checks if folder wasn't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 24, 2021
1 parent d13afec commit 11dc184
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@

. "$(dirname "$0")/_/husky.sh"

cd tooling/api
yarn format
yarn lint-fix
if [ -z "$(git diff --name-only tooling/api)" ]; then
echo "skipping api - no changes detected"
else
cd tooling/api
yarn format
yarn lint-fix
cd ../..
fi

cd ../cli.js
yarn format
yarn lint-fix
if [ -z "$(git diff --name-only tooling/cli.js)" ]; then
echo "skipping cli.js - no changes detected"
else
cd tooling/cli.js
yarn format
yarn lint-fix
cd ../..
fi

cd ../create-tauri-app
yarn format
yarn lint-fix
if [ -z "$(git diff --name-only tooling/create-tauri-app)" ]; then
echo "skipping create-tauri-app - no changes detected"
else
cd tooling/create-tauri-app
yarn format
yarn lint-fix
cd ../..
fi

0 comments on commit 11dc184

Please sign in to comment.