anki/.github/scripts/trailing-newlines.sh
evandrocoan 721453f923 Merge remote-tracking branch 'danielelmes/master' into create_actions_for_windows_macos
# Conflicts:
#	.github/scripts/trailing-newlines.sh
#	.github/workflows/checks.yml
#	Makefile
#	pylib/Makefile
#	qt/Makefile
#	qt/tools/typecheck-setup.sh
#	rspy/Makefile
2020-03-24 22:49:49 -03:00

16 lines
401 B
Bash
Executable File

#!/bin/bash
set -eu -o pipefail ${SHELLFLAGS}
# 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