Skip to content

Commit fa60ee9

Browse files
committed
Skip fmtscan on macOS
The tool 'fmtscan' requires POSIX message queues which are unavailable on macOS. Skip build and execution of 'fmtscan' on non-Linux platforms. Change-Id: I5648a61b94a87b1a691c14e12fb3d75c11d3dfa1
1 parent 77d8deb commit fa60ee9

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)