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