summaryrefslogtreecommitdiffstats
path: root/scripts/build.sh
blob: 0e24216bd0a73b496d3edf84a65d86d5901376c2 (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' > "output${1#"src/icons"}"
}

export -f handle

mkdir -p output

find "src/icons" \
    -type f \
    -name "*.svg" \
    -print0 | parallel -0 handle {}