mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fixed trailing-newlines.sh not failing when rg is not installed
This commit is contained in:
parent
88ea0b18bf
commit
d6f900647b
1 changed files with 6 additions and 2 deletions
8
.github/scripts/trailing-newlines.sh
vendored
8
.github/scripts/trailing-newlines.sh
vendored
|
@ -1,8 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -eo pipefail
|
||||||
|
|
||||||
files=$(rg -l '[^\n]\z' -g '!*.{svg,scss,json}' || true)
|
# Checking version to force it fail the build if rg is not installed.
|
||||||
|
# Because `set -e` does not work inside the subshell $()
|
||||||
|
rg --version
|
||||||
|
|
||||||
|
files=$(rg -l '[^\n]\z' -g '!*.{png,svg,scss,json}' || true)
|
||||||
if [ "$files" != "" ]; then
|
if [ "$files" != "" ]; then
|
||||||
echo "the following files are missing a newline on the last line:"
|
echo "the following files are missing a newline on the last line:"
|
||||||
echo $files
|
echo $files
|
||||||
|
|
Loading…
Reference in a new issue