freebsd-dev/contrib/libcbor/clang-format.sh
Ed Maste 10ff414c14 Import libcbor at 'contrib/libcbor/'
git-subtree-dir: contrib/libcbor
git-subtree-mainline: 293663f4da
git-subtree-split: 5b2defbd2a
2021-10-06 20:26:10 -04:00

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