10ff414c14
git-subtree-dir: contrib/libcbor git-subtree-mainline: 293663f4da9e8b8aeb106ce3b73a8ed2aa2a8a90 git-subtree-split: 5b2defbd2a1aa991bd0a2855eef8e15107572747
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
|
|
|