Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Fix ts file identification in pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay authored and svartalf committed May 2, 2020
1 parent 7f00d10 commit b223206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This script can yield false positives in cases where you only make stylistic changes to the TypeScript code that don't result in changes to the compiled JavaScript code.
# It is your responsibility as a developer to then commit the changes with `git commit --no-verify` and simply skip this commit hook.

TS_FILES=$(git diff --staged --name-only | grep -c '.ts')
TS_FILES=$(git diff --staged --name-only | grep -c '\.ts$')
DIST_MODIFIED=$(git diff --staged --name-only | grep -c dist/index.js)

if [ $TS_FILES -gt 0 ] && [ $DIST_MODIFIED -eq 0 ] ; then
Expand Down

0 comments on commit b223206

Please sign in to comment.