mirror of https://github.com/zeldaret/tmc.git
Only touch file if new line is needed
This commit is contained in:
parent
4a4c361045
commit
9df21c9c2c
|
@ -26,5 +26,7 @@ echo "Running clang-tidy..."
|
||||||
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
|
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
|
||||||
clang-tidy ${TIDY_OPTS} include/**/*.h -- ${COMPILER_OPTS} &> /dev/null
|
clang-tidy ${TIDY_OPTS} include/**/*.h -- ${COMPILER_OPTS} &> /dev/null
|
||||||
echo "Adding missing final new lines..."
|
echo "Adding missing final new lines..."
|
||||||
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
|
|
||||||
|
# only run sed if no line at the end of file so we don't unnecessarily touch the file.
|
||||||
|
find src/ -type f -name "*.c" -exec bash -c 'if [[ -n "$(tail -c 1 {})" ]]; then sed -i -e '"'"'$a\'"'"' {}; fi' \;
|
||||||
echo "Done formatting all files."
|
echo "Done formatting all files."
|
||||||
|
|
Loading…
Reference in New Issue