foundation/tools/ensure-new-lines.sh

11 lines
188 B
Bash
Executable File

#!/usr/bin/env bash
set -e
git ls-files -z | while IFS= read -rd '' f
do
if file --mime-encoding "$f" | grep -qv binary
then
tail -c1 < "$f" | read -r _ || echo >> "$f"
fi
done