Skip to content

Commit

Permalink
Handle deleted files properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
kward committed Apr 12, 2020
1 parent 29148b0 commit e87aa62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .githooks/pre-commit.shellcheck
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ fi

success=${TRUE}
for f in $(git diff --cached --name-only); do
# Check for file deletion.
if [ ! -r "${f}" ]; then
continue
fi

cmd=':'
case "${f}" in
shflags|shflags_test_helpers) cmd="shellcheck -s sh ${f}" ;;
Expand Down

0 comments on commit e87aa62

Please sign in to comment.