Fix bug where convert script fails silently if dependency is not found

This commit is contained in:
Goh Jia Hao 2016-05-28 19:22:32 +08:00
parent 6fccbbfaa5
commit 729b5d5749
3 changed files with 5 additions and 29 deletions

View File

@ -13,17 +13,8 @@ set -e
CONVERT_TO_PNG="${BASH_SOURCE%/*}/convertToPng"
# Exec Paths
ICONUTIL=$(which iconutil)
IMAGEMAGICK_CONVERT=$(which convert)
if [ ! -x "${ICONUTIL}" ]; then
echo "Cannot find required iconutil executable" >&2
exit 1;
fi
if [ ! -x "${IMAGEMAGICK_CONVERT}" ]; then
echo "Cannot find required ImageMagick Convert executable" >&2
exit 1;
fi
type convert >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Convert executable"; exit 1; }
type iconutil >/dev/null 2>&1 || { echo >&2 "Cannot find required iconutil executable"; exit 1; }
# Parameters
SOURCE=$1

View File

@ -8,12 +8,7 @@
set -e
IMAGEMAGICK_CONVERT=$(which convert)
if [ ! -x "${IMAGEMAGICK_CONVERT}" ]; then
echo "Cannot find required ImageMagick Convert executable" >&2
exit 1;
fi
type convert >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Convert executable"; exit 1; }
SOURCE=$1
DEST=$2

View File

@ -8,18 +8,8 @@
set -e
# Exec Paths
IMAGEMAGICK_CONVERT=$(which convert)
IMAGEMAGICK_IDENTIFY=$(which identify)
if [ ! -x "${IMAGEMAGICK_CONVERT}" ]; then
echo "Cannot find required ImageMagick Convert executable" >&2
exit 1;
fi
if [ ! -x "${IMAGEMAGICK_IDENTIFY}" ]; then
echo "Cannot find required ImageMagick Identify executable" >&2
exit 1;
fi
type convert >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Convert executable"; exit 1; }
type identify >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Identify executable"; exit 1; }
# Parameters
SOURCE=$1