Skip to content

Commit

Permalink
Update functions.sh: Use ${wBR} instead of hard-coded \n
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Jan 22, 2025
1 parent 41b9b58 commit 82684f6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NOT_STARTED_MSG="Can't start Allsky!"
STOPPED_MSG="Allsky Stopped!"
ERROR_MSG_PREFIX="*** ERROR ***\n${STOPPED_MSG}\n"
FATAL_MSG="FATAL ERROR:"

if [[ ${ON_TTY} == "true" ]]; then
export NL="\n"
export SPACES=" "
Expand Down Expand Up @@ -817,23 +818,23 @@ function checkCropValues()
local ERR=""
if [[ ${CROP_TOP} -lt 0 || ${CROP_RIGHT} -lt 0 ||
${CROP_BOTTOM} -lt 0 || ${CROP_LEFT} -lt 0 ]]; then
ERR+="\nCrop numbers must all be positive."
ERR+="${wBR}Crop numbers must all be positive."
fi
if [[ $((CROP_TOP % 2)) -eq 1 || $((CROP_RIGHT % 2)) -eq 1 ||
$((CROP_BOTTOM % 2)) -eq 1 || $((CROP_LEFT % 2)) -eq 1 ]]; then
ERR+="\nCrop numbers must all be even."
ERR+="${wBR}Crop numbers must all be even."
fi
if [[ ${CROP_TOP} -gt $((MAX_RESOLUTION_Y -2)) ]]; then
ERR+="\nCropping on top (${CROP_TOP}) is larger than the image height (${MAX_RESOLUTION_Y})."
ERR+="${wBR}Cropping on top (${CROP_TOP}) is larger than the image height (${MAX_RESOLUTION_Y})."
fi
if [[ ${CROP_RIGHT} -gt $((MAX_RESOLUTION_X - 2)) ]]; then
ERR+="\nCropping on right (${CROP_RIGHT}) is larger than the image width (${MAX_RESOLUTION_X})."
ERR+="${wBR}Cropping on right (${CROP_RIGHT}) is larger than the image width (${MAX_RESOLUTION_X})."
fi
if [[ ${CROP_BOTTOM} -gt $((MAX_RESOLUTION_Y - 2)) ]]; then
ERR+="\nCropping on bottom (${CROP_BOTTOM}) is larger than the image height (${MAX_RESOLUTION_Y})."
ERR+="${wBR}Cropping on bottom (${CROP_BOTTOM}) is larger than the image height (${MAX_RESOLUTION_Y})."
fi
if [[ ${CROP_LEFT} -gt $((MAX_RESOLUTION_X - 2)) ]]; then
ERR+="\nCropping on left (${CROP_LEFT}) is larger than the image width (${MAX_RESOLUTION_X})."
ERR+="${wBR}Cropping on left (${CROP_LEFT}) is larger than the image width (${MAX_RESOLUTION_X})."
fi

if [[ -z ${ERR} ]]; then
Expand Down

0 comments on commit 82684f6

Please sign in to comment.