summarylogtreecommitdiffstats
path: root/svgo.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'svgo.sh.in')
-rw-r--r--svgo.sh.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/svgo.sh.in b/svgo.sh.in
index f997a855a0b..13b46c1fd16 100644
--- a/svgo.sh.in
+++ b/svgo.sh.in
@@ -19,10 +19,12 @@ tidy_svgo() {
msg2 "$(gettext "Optimizing SVG images...")"
local svg
find . -type f -iname "*.svg" 2>/dev/null | while read -r svg ; do
+ [ $(jobs -p|wc -l) -gt $(nproc) ] && wait -n
if [[ $(file --brief --mime-type "$svg") = 'image/svg' ]]; then
- svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null ||
- warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}"
+ { svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null ||
+ warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}"; } &
fi
done
+ wait
fi
}