Skip to content

Commit

Permalink
Update generate_notification_images.sh: minor formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Sep 16, 2023
1 parent b28638d commit 72afd8a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/generate_notification_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# This is quick - on a Pi 4 it takes about one second per image.

# Allow this script to be executed manually, which requires several variables to be set.
[[ -z ${ALLSKY_HOME} ]] && export ALLSKY_HOME="$(realpath "$(dirname "${BASH_ARGV0}")/..")"
ME="$(basename "${BASH_ARGV0}")"
[[ -z ${ALLSKY_HOME} ]] && export ALLSKY_HOME="$( realpath "$( dirname "${BASH_ARGV0}" )/.." )"
ME="$( basename "${BASH_ARGV0}" )"

#shellcheck disable=SC2086 source-path=.
source "${ALLSKY_HOME}/variables.sh" || exit ${ALLSKY_ERROR_STOP}
#shellcheck source-path=.
source "${ALLSKY_HOME}/variables.sh" || exit "${ALLSKY_ERROR_STOP}"

readonly ALL_EXTS="jpg png" # all the image filename extensions we support

Expand All @@ -35,8 +35,7 @@ function usage_and_exit()
echo " '--size XxY' creates images that are X by Y pixels. Default: ${DEFAULT_IMAGE_SIZE} pixels."
echo
) >&2
# shellcheck disable=SC2086
exit ${RET}
exit "${RET}"
}

# Check arguments
Expand Down Expand Up @@ -159,8 +158,7 @@ function make_image()
done
}

which mogrify > /dev/null
if [[ $? -ne 0 ]]; then
if ! which mogrify > /dev/null ; then
# Testing for mogrify which seems like a much more distinctive executable
# name than "convert". I assume that if "mogrify" is in the path, then
# ImageMagick is installed and "convert" will run ImageMagick and not some
Expand Down

0 comments on commit 72afd8a

Please sign in to comment.