diff --git a/.husky/pre-commit b/.husky/pre-commit index b2688a6..fcca948 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,11 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" + +if [[ $(git diff --cached --name-only | grep -E 'registry/.+\.chain\.json') ]]; then + bun run scripts/codegen-chains.ts + git add . + git commit --no-verify -m "chore: update generated files" +fi + bunx pretty-quick --staged \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push index 131b0d2..70cc683 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -7,4 +7,4 @@ bun run test bun run scripts/codegen-chains.ts # add & commit files to git without triggering husky git add . -git commit --amend --no-edit --no-verify +git commit --no-verify -m "chore: update generated files"