anki/.github/scripts/trailing-newlines.sh
evandrocoan b1b3e5b87c Merge remote-tracking branch 'danielelmes/master' into fix_tests_on_windows
# Conflicts:
#	.github/scripts/trailing-newlines.sh
2020-03-23 18:44:11 -03:00

16 lines
384 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
# Checking version to force it fail the build if rg is not installed.
# Because `set -e` does not work inside the subshell $()
rg --version > /dev/null 2>&1
files=$(rg -l '[^\n]\z' -g '!*.{png,svg,scss,json,sql}' || true)
if [ "$files" != "" ]; then
echo "the following files are missing a newline on the last line:"
echo $files
exit 1
fi