diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 04:51:40 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-08 01:50:02 -0800 |
commit | 5c624298a1145bdcd7e279642f9155ab114b94c2 (patch) | |
tree | 06af3b451945c3a63e6729662a51d5afd289f1c7 | |
parent | 8a4d4662c80784a8a7102a02e8f4af35719ca86f (diff) |
Factor out pngcrush.sh filenames.
-rwxr-xr-x | pngcrush.sh | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pngcrush.sh b/pngcrush.sh index aa69576..d74845a 100755 --- a/pngcrush.sh +++ b/pngcrush.sh @@ -5,10 +5,15 @@ out=$2 steps=() +src=_.png +dst=__.png + +copy=("${src}" "${dst}") + function step() { "$@" - mv -f {_,}_.png - steps+=($(stat -f "%z" _.png)) + mv -f "${dst}" "${src}" + steps+=($(stat -f "%z" "${src}")) } pngcrush=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush @@ -21,20 +26,20 @@ if grep CgBI "${png}" &>/dev/null; then exit 0 fi -step cp -fa "${png}" __.png +step cp -fa "${png}" "${dst}" -#step "${pngcrush}" -q -rem alla -reduce -brute -iphone {,_}_.png +#step "${pngcrush}" -q -rem alla -reduce -brute -iphone "${copy[@]}" -#step "${pngcrush}" -q -rem alla -reduce -brute {,_}_.png -#step pincrush {,_}_.png +#step "${pngcrush}" -q -rem alla -reduce -brute "${copy[@]}" +#step pincrush "${copy[@]}" -step "${pngcrush}" -q -rem alla -reduce -iphone {,_}_.png +step "${pngcrush}" -q -rem alla -reduce -iphone "${copy[@]}" #"${pngcrush}" -q -rem alla -reduce -brute -iphone "${png}" 1.png #"${pngcrush}" -q -iphone _.png 2.png #ls -la 1.png 2.png -mv -f _.png "${out}" +mv -f "${src}" "${out}" echo -n "${png##*/} " for ((i = 0; i != ${#steps[@]}; ++i)); do |