From b228faae74d4afb58836de912a1a3251be6f803b Mon Sep 17 00:00:00 2001 From: "Ryan P.C. McQuen" Date: Sat, 21 Mar 2015 14:52:16 -0700 Subject: [PATCH] only fill mac path on macs; simplify parameter check Signed-off-by: Ryan P.C. McQuen --- imgult | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imgult b/imgult index 39098ac..a5e040d 100755 --- a/imgult +++ b/imgult @@ -51,7 +51,9 @@ RUN_OVERLOAD_PROTECTION_ENCABULATOR() { } if [ -z "$JPEGTRAN" ]; then - MACOSJPEGTRAN=`find /usr/local/Cellar/mozjpeg -name jpegtran | tail -1 | cut -d/ -f1-7` + if [ `uname` = "Darwin" ]; then + MACOSJPEGTRAN=`find /usr/local/Cellar/mozjpeg -name jpegtran | tail -1 | cut -d/ -f1-7` + fi export PATH=$MACOSJPEGTRAN:/opt/libmozjpeg/bin:/opt/mozjpeg/bin:$PATH JPEGTRAN="$(which jpegtran)" fi @@ -83,7 +85,7 @@ du -hs "$@" > preImgultSize ## i was originally checking if "$@" was empty, ## but it turns out that is a nightmare if regex ## paths are fed to imgult -if [ "$#" -lt 1 ]; then +if [ $# -eq 0 ]; then set -- . fi