Add newline to end of file

For yaml files, there should always be a newline character at the end of the file. It's easy to overlook, and some editors are misconfigured to remove trailing newlines, meaning it can be a battle to keep your yaml syntactically correct. When you can't use tools like yamllint to fix things, here's a one-liner that does the job.

find . -name "*.yaml" -exec sh -c 'if [ -n "$(tail -c 1 "$1")" ]; then echo "" >> "$1"; fi' _ {} \;