locale/tools/format_sources.sh
Alexander Grund 2f08363794 Update Readme
Fix spelling and link to format_sources
Also use `find -exec` instead of `xargs`
2023-06-29 17:20:33 +02:00

22 lines
483 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2022 Alexander Grund
#
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
# Format source code with clang-format
set -euo pipefail
CLANG_FORMAT="clang-format-14"
if ! command -v "$CLANG_FORMAT" &> /dev/null; then
echo "You need $CLANG_FORMAT in your PATH"
exit 1
fi
cd "$(dirname "$0")/.."
find . -type f \( -name '*.cpp' -o -name '*.hpp' \) -exec "$CLANG_FORMAT" -i --style=file {} \;