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" CONVERT_TO_PNG="${BASH_SOURCE%/*}/convertToPng"
# Exec Paths # Exec Paths
ICONUTIL=$(which iconutil) type convert >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Convert executable"; exit 1; }
IMAGEMAGICK_CONVERT=$(which convert) type iconutil >/dev/null 2>&1 || { echo >&2 "Cannot find required iconutil executable"; exit 1; }
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
# Parameters # Parameters
SOURCE=$1 SOURCE=$1

View File

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

View File

@ -8,18 +8,8 @@
set -e set -e
# Exec Paths type convert >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Convert executable"; exit 1; }
IMAGEMAGICK_CONVERT=$(which convert) type identify >/dev/null 2>&1 || { echo >&2 "Cannot find required ImageMagick Identify executable"; exit 1; }
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
# Parameters # Parameters
SOURCE=$1 SOURCE=$1