blob: 3cf35874011a06f858d2901656c81b8dcd29d0a0 [file] [log] [blame] [edit]
#!/usr/bin/env bash
# Wrapper to clean up newlines
# We could do this in tcl...but tcl
fn=$1
third_party/reformat.tcl $fn >/dev/null
# Always puts a newline at the end, even if there was one before
# remove duplicates, but keep at least one
printf "%s\n" "$(< $fn)" >$fn.tmp
mv $fn.tmp $fn
# Remove trailing spaces
sed -i 's/[ \t]*$//' "$fn"