prime/tools/clang-format.sh

16 lines
255 B
Bash
Executable File

#!/bin/bash -e
function add_newline {
if [[ -z "$(tail -c 1 "$1")" ]]; then
:
else
echo >> "$1"
fi
}
FILES=$(git ls-files -c "*.h" "*.hpp" "*.c" "*.cpp")
clang-format -i ${FILES}
for f in ${FILES}; do
add_newline $f
done