find-unused-css: Fix shellcheck warnings.

In tools/find-unused-css line 5:
    if [ $(git grep "$n" | grep -v '^static/styles/zulip.css' | wc -l) -eq 0 ]; then
         ^-- SC2046: Quote this to prevent word splitting.
                           ^-- SC2126: Consider using grep -c instead of grep|wc -l.

In tools/find-unused-css line 6:
        echo $n
             ^-- SC2086: Double quote to prevent globbing and word splitting.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2018-08-03 00:14:49 +00:00 committed by Tim Abbott
parent b920d19358
commit cd451491ff
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Hackish tool for attempting to find unused IDs / classes in our CSS
for n in $(perl -lne 'print $1 while /[#.]([a-zA-Z0-9_-]+)/g' static/styles/zulip.css | sort -u); do
if [ $(git grep "$n" | grep -v '^static/styles/zulip.css' | wc -l) -eq 0 ]; then
echo $n
if [ "$(git grep "$n" | grep -cv '^static/styles/zulip.css')" -eq 0 ]; then
echo "$n"
fi
done