From 2eefd14231a2ec49aa236053c7cac85e15c21299 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 4 Dec 2013 19:42:18 -0800 Subject: [PATCH] fix so --clean gets respected --- xwords4/android/scripts/mkimages.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xwords4/android/scripts/mkimages.sh b/xwords4/android/scripts/mkimages.sh index 608b87710..e1442caca 100755 --- a/xwords4/android/scripts/mkimages.sh +++ b/xwords4/android/scripts/mkimages.sh @@ -9,11 +9,22 @@ fi CLEAN="" -if [ $# -gt 1 ]; then - if [ $1 = '--clean' ]; then - CLEAN=1 - fi -fi +usage() { + echo "usage: $0 [--clean]" + exit 1 +} + +while [ $# -ge 1 ]; do + case $1 in + --clean) + CLEAN=1 + ;; + *) + usage + ;; + esac + shift +done # There needs to be target in the makefile for each of these (giving # the output .png size) @@ -26,6 +37,7 @@ for SVG in img_src/*.svg; do SVG=$(basename $SVG) OUT=res/$DIR/${SVG/.svg/__gen.png} if [ -z "$CLEAN" ]; then + echo "not doing clean one" make -f $(dirname $0)/images.mk $OUT else rm -f $OUT