Skip to content

Commit

Permalink
only fill mac path on macs; simplify parameter check
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan P.C. McQuen <[email protected]>
  • Loading branch information
Ryan P.C. McQuen committed Mar 21, 2015
1 parent 82d30bb commit b228faa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions imgult
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b228faa

Please sign in to comment.