os161-assignments/helper_scripts/clang-format-helper.sh

16 lines
236 B
Bash
Executable File

#!/bin/sh
set -e
if [ "$1" = "" ]; then
echo "argument cannot be empty"
exit 1
fi
cd $1
echo "IncludeBlocks: Preserve
SortIncludes: Never" > .clang-format
find . -type f \( -iname \*.c -o -iname \*.h \) | xargs clang-format -i