blob: 8752327703497531c084536be29a2fa1a233bf46 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/bash
handle () {
scour -i "$1" \
--enable-viewboxing \
--enable-id-stripping \
--enable-comment-stripping \
--remove-descriptive-elements \
--strip-xml-prolog \
--shorten-ids | sed -z 's/\(fill\|stroke\)="#.\{3,6\}"/\1="currentColor"/g;s/stroke-width="[0-9.]*"//g' > "output${1#"src/icons"}"
}
export -f handle
mkdir -p output
find "src/icons" \
-type f \
-name "*.svg" \
-print0 | parallel -0 handle {}
|