File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed
Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ INKSCAPE=" inkscape"
4+ OPTIPNG=" optipng"
5+
6+ SRC_FILE=" assets.svg"
7+ ASSETS_DIR=" ."
8+
9+ INDEX=" assets.txt"
10+
11+ # check command avalibility
12+ has_command () {
13+ " $1 " -v $1 > /dev/null 2>&1
14+ }
15+
16+ mkdir -p $ASSETS_DIR
17+
18+ for i in ` cat $INDEX `
19+ do
20+ if ! [ -f $ASSETS_DIR /$i .png ]; then
21+ echo Rendering $ASSETS_DIR /$i .png
22+
23+ $INKSCAPE --export-id=$i \
24+ --export-id-only \
25+ --export-filename=$ASSETS_DIR /$i .png $SRC_FILE > /dev/null
26+ $OPTIPNG -o7 --quiet $ASSETS_DIR /$i .png
27+ fi
28+ done
29+ exit 0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ INKSCAPE=" inkscape"
4+ OPTIPNG=" optipng"
5+
6+ SRC_FILE=" assets.svg"
7+ ASSETS_DIR=" ."
8+
9+ INDEX=" assets.txt"
10+
11+ # check command avalibility
12+ has_command () {
13+ " $1 " -v $1 > /dev/null 2>&1
14+ }
15+
16+ mkdir -p $ASSETS_DIR
17+
18+ for i in ` cat $INDEX `
19+ do
20+ if ! [ -f $ASSETS_DIR /$i .png ]; then
21+ echo Rendering $ASSETS_DIR /$i .png
22+
23+ $INKSCAPE --export-id=$i \
24+ --export-id-only \
25+ --export-filename=$ASSETS_DIR /$i .png $SRC_FILE > /dev/null
26+ $OPTIPNG -o7 --quiet $ASSETS_DIR /$i .png
27+ fi
28+ done
29+ exit 0
You can’t perform that action at this time.
0 commit comments