3 # Renders SVG files from ./path/file.svg to OUTDIR/path/file.tga
4 # Overwrites existing tga files
7 # ./render.sh OUTDIR SVG...
10 # One file: ./render.sh ~/.xonotic/data gfx/hud/luma/armor.svg
11 # All files: ./render.sh ~/.xonotic/data $(find . -name "*.svg")
22 # Extract name components
23 svgDir=$(dirname -- "$svg")
24 svgName=$(basename -- "$svg" .svg)
26 # Compose target file names
28 tga="$dir/$svgName.tga"
29 tmp="$dir/$svgName.tmp.png"
31 # Ensure target directory exists
34 # Because Inkscape makes it difficult to write to
35 # stdout for piping, a temporary file is used instead
36 inkscape -f "$svg" -e "$tmp"