improve shell scripts and update .gitignore

This commit is contained in:
zapashcanon 2019-04-24 01:55:05 +02:00
parent 33b1f37e37
commit eee6f2de31
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
8 changed files with 93 additions and 73 deletions

View file

@ -1,14 +1,15 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# Runs the Clang Formatter
# Return codes:
# - 1 there are files to be formatted
# - 0 everything looks fine
set -o errexit
set -o pipefail
set -o nounset
set -eu
FILES=`find src -type f -type f \( -iname "*.cpp" -o -iname "*.h" \)`
FILES=$(find src -type f -type f \( -iname "*.cpp" -o -iname "*.h" \))
clang-format -i $FILES && git diff --exit-code
for f in $FILES
do
clang-format -i "$f" && git diff --exit-code
done;