From 9aba11f7b6a291fa70e95cd9ed20488ca5a369ec Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 2 Jul 2023 08:05:45 +0200 Subject: Add check for unlisted icons for and correct accordingly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- find-unlisted-icons | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 find-unlisted-icons (limited to 'find-unlisted-icons') diff --git a/find-unlisted-icons b/find-unlisted-icons new file mode 100755 index 0000000..f493178 --- /dev/null +++ b/find-unlisted-icons @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +for f in scalable/*/*.svg; do + if test -e "$f"; then + printf '%s\n' "$f" + fi +done | sed 's/^scalable\/\(.*\)\.svg$/\1/' | sort > "/tmp/pid-$$-a" + +sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed 1d | tr -d '\t' | sort > "/tmp/pid-$$-b" + +unlisted="$(comm -23 "/tmp/pid-$$-a" "/tmp/pid-$$-b")" +rm "/tmp/pid-$$-a" "/tmp/pid-$$-b" + +if test -n "$unlisted"; then + printf '%s\n' 'The following icons exist but are not listed in icons.mk' "$unlisted" >&2 + exit 1 +fi -- cgit v1.2.3-70-g09d2