only render svg to png if the png does not exist

Sat, 05 Mar 2022 13:19:59 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 05 Mar 2022 13:19:59 +0200
changeset 162
3ebe1a0ca818
parent 161
6fe485a84d06
child 163
36ea1a8aee33

only render svg to png if the png does not exist

svg-to-png.sh file | annotate | diff | comparison | revisions
--- a/svg-to-png.sh	Sat Mar 05 13:18:40 2022 +0200
+++ b/svg-to-png.sh	Sat Mar 05 13:19:59 2022 +0200
@@ -3,6 +3,9 @@
 for svgfile in $(find icons_svg -name '*.svg')
 do
 	pngfile="icons/$(basename ${svgfile%.svg}.png)"
-	echo "$svgfile => $pngfile"
-	convert -background none "${svgfile}" "${pngfile}"
+	if [[ ! -f "${pngfile}" ]]
+	then
+		echo "$svgfile => $pngfile"
+		convert -background none "${svgfile}" "${pngfile}"
+	fi
 done

mercurial