Fix Shellcheck SC2086: Quote to prevent splitting

Double quote to prevent globbing and word splitting.

https://github.com/koalaman/shellcheck/wiki/SC2086

Signed-off-by: Dan Callahan <danc@element.io>
This commit is contained in:
Dan Callahan 2021-10-22 22:46:06 +01:00
parent 31096132c3
commit 13f084eb58
No known key found for this signature in database
GPG key ID: 5FAD56482D9EB851
13 changed files with 42 additions and 42 deletions

View file

@ -44,8 +44,8 @@ echo
matched=0
for f in `git diff --name-only FETCH_HEAD... -- changelog.d`; do
# check that any modified newsfiles on this branch end with a full stop.
lastchar=`tr -d '\n' < $f | tail -c 1`
if [ $lastchar != '.' ] && [ $lastchar != '!' ]; then
lastchar=`tr -d '\n' < "$f" | tail -c 1`
if [ "$lastchar" != '.' ] && [ "$lastchar" != '!' ]; then
echo -e "\e[31mERROR: newsfragment $f does not end with a '.' or '!'\e[39m" >&2
echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2
exit 1