Skip to content

Commit

Permalink
refactor: whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhardy committed Apr 3, 2020
1 parent cfa59c8 commit d189894
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

# This file should be copied to <repo root>/.git/hooks/pre-commit to enable pre-commit checks

Expand All @@ -7,15 +7,15 @@ exec 1>&2

# Check shellcheck available
if ! command -v shellcheck >/dev/null 2>&1; then
echo "ERROR: shellcheck does not appear to be installed"
exit 1
echo "ERROR: shellcheck does not appear to be installed"
exit 1
fi

# Run shellcheck on all shell files
for FILE in $(git diff --cached --name-only); do
if head -1 "${FILE}" | grep -q -E "^#!.*sh$"; then
if ! shellcheck "${FILE}"; then
exit 1
fi
fi
if head -1 "${FILE}" | grep -q -E "^#!.*sh$"; then
if ! shellcheck "${FILE}"; then
exit 1
fi
fi
done

0 comments on commit d189894

Please sign in to comment.