Skip to content

Commit

Permalink
Allow us to find inkscape on OS X and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
DDRBoxman committed Feb 20, 2012
1 parent c58e6a8 commit e8fb6c4
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions process_assets
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ function processImage {
echo "Processing $1"

file=$(basename $1)
inkscape -d 320 -e $2/res/drawable-xhdpi/${file/.svg}.png $1 >& /dev/null
inkscape -d 240 -e $2/res/drawable-hdpi/${file/.svg}.png $1 >& /dev/null
inkscape -d 160 -e $2/res/drawable-mdpi/${file/.svg}.png $1 >& /dev/null
inkscape -d 120 -e $2/res/drawable-ldpi/${file/.svg}.png $1 >& /dev/null

case $OSTYPE in
darwin*)
inkscape= "/Applications/Inkscape.app/Contents/Resources/bin/inkscape"
;;
linux-gnu*)
inkscape="inkscape"
;;
esac

$inkscape -d 320 -e $2/res/drawable-xhdpi/${file/.svg}.png $1 >& /dev/null
$inkscape -d 240 -e $2/res/drawable-hdpi/${file/.svg}.png $1 >& /dev/null
$inkscape -d 160 -e $2/res/drawable-mdpi/${file/.svg}.png $1 >& /dev/null
$inkscape -d 120 -e $2/res/drawable-ldpi/${file/.svg}.png $1 >& /dev/null
}

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down

0 comments on commit e8fb6c4

Please sign in to comment.