source: git/lib/icons/svg2iconsetzip

walls-data
Last change on this file was 5aeb91c, checked in by Olly Betts <olly@…>, 2 years ago

svg2iconsetzip: Report missing inkscape clearly

  • Property mode set to 100755
File size: 676 bytes
Line 
1#!/bin/sh
2set -e
3
4inkscape --version > /dev/null || { echo "Error: Inkscape needed to generate macos iconset files"; exit 1; }
5
6case $1 in
7  -*) in=./$1 ;;
8  *) in=$1 ;;
9esac
10case $2 in
11  -*) out=./$2 ;;
12  *) out=$2 ;;
13esac
14tmp=`echo "$out"|sed 's/\.zip$//'`
15
16rm -rf "$tmp"
17mkdir "$tmp"
18for r in 16 32 128 256 512 ; do
19  inkscape -w "$r" -h "$r" --export-filename="$tmp/icon_${r}x${r}.png" "$in"
20done
21for r in 16 128 256 ; do
22  d=`expr $r + $r`
23  ln "$tmp/icon_${d}x${d}.png" "$tmp/icon_${r}x${r}@2x.png"
24done
25for r in 32 512 ; do
26  d=`expr $r + $r`
27  inkscape -w "$d" -h "$d" --export-filename="$tmp/icon_${r}x${r}@2x.png" "$in"
28done
29rm -f "$out"
30zip --move -r "$out" "$tmp"
Note: See TracBrowser for help on using the repository browser.