anki/.github/scripts/trailing-newlines.sh
evandrocoan 1ade1a1a0f Fixed moved comment line on qt/aqt/main.py, long variables names on
pylib/Makefile and qt/Makefile, and rg --version not going to /dev/null
on .github/scripts/trailing-newlines.sh
2020-03-18 11:36:50 -03:00

15 lines
379 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}' || true)
if [ "$files" != "" ]; then
echo "the following files are missing a newline on the last line:"
echo $files
exit 1
fi