Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 404 Bytes

clean_repo.md

File metadata and controls

17 lines (15 loc) · 404 Bytes
for file in $(git ls-files -- . ':!:*.png' ':!:*.pdf' ':!:*.tar.gz'); do
  sed -i 's/^[[:space:]]*$//' $file
  sed -i 's/[[:space:]]*$//' $file
  [ -n "$(tail -c1 $file)" ] && echo >> $file
done

See files with no newline at the end of file

for file in $(git ls-files -- . ':!:*.png' ':!:*.pdf' ':!:*.tar.gz'); do
  if [ -n "$(tail -c1 $file)" ]; then
    echo $file
  fi
done