Skip to content

Commit 59b5363

Browse files
authored
Merge pull request #261 from sysprog21/macos-compat
Skip fmtscan on macOS
2 parents 77d8deb + fa60ee9 commit 59b5363

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

scripts/pre-commit.hook

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,20 @@ for file in $C_FILES; do
235235
done
236236

237237
# format string checks
238-
if [ ! -f fmtscan ]; then
238+
if [[ "$OSTYPE" != darwin* ]]; then
239+
# Format string checks
240+
if [ ! -f fmtscan ]; then
239241
make fmtscan
240242
if [ ! -f fmtscan ]; then
241-
throw "Fail to build 'fmtscan' tools"
243+
throw "Fail to build 'fmtscan' tool"
244+
fi
245+
fi
246+
if [ -n "$C_FILES" ]; then
247+
echo "Running fmtscan..."
248+
./fmtscan
249+
if [ $? -ne 0 ]; then
250+
throw "Check format strings for spelling"
242251
fi
243-
fi
244-
if [ -n "$C_FILES" ]; then
245-
echo "Running fmtscan..."
246-
./fmtscan
247-
if [ $? -ne 0 ]; then
248-
throw "Check format strings for spelling"
249252
fi
250253
fi
251254

0 commit comments

Comments
 (0)