git-subtree-dir: contrib/libcbor git-subtree-mainline:293663f4da
git-subtree-split:5b2defbd2a
18 lines
442 B
Bash
Executable File
18 lines
442 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Usage: ./clang-format.sh <extra arguments>
|
|
|
|
DIRS="src test examples"
|
|
SOURCES=$(find ${DIRS} -name "*.c")
|
|
SOURCES+=" $(find ${DIRS} -name "*.h")"
|
|
SOURCES+=" $(find ${DIRS} -name "*.cpp")"
|
|
|
|
# TravisCI workaround to use new clang-format while avoiding painful aliasing
|
|
# into the subshell
|
|
if which clang-format-8; then
|
|
clang-format-8 $@ -style=file -i ${SOURCES}
|
|
else
|
|
clang-format $@ -style=file -i ${SOURCES}
|
|
fi
|
|
|