FTXUI/tools/format.sh

20 lines
355 B
Bash
Raw Permalink Normal View History

2020-04-20 03:00:37 +08:00
#!/bin/bash
cd "$(dirname "$0")"
cd ..
# Add the license file.
files=$(find ./src ./include ./examples -name "*.hpp" -o -name "*.cpp")
for file in $files
do
if ! grep -q Copyright $file
then
2023-08-19 19:56:36 +08:00
cat ./tools/license_headers.cpp $file > $file.new && mv $file.new $file
2020-04-20 03:00:37 +08:00
fi
done
# Use clang-format.
for file in $files
do
clang-format -i $file
done