diff --git a/tools/ensure-new-lines.sh b/tools/ensure-new-lines.sh new file mode 100755 index 0000000..c4f13ea --- /dev/null +++ b/tools/ensure-new-lines.sh @@ -0,0 +1,10 @@ +#!/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