fix return

This commit is contained in:
Antonio J. Delgado 2023-04-19 18:16:24 +03:00
parent 6642199d38
commit 293f6d565c

View file

@ -24,12 +24,12 @@ check_font() {
font_name="${1}"
convert_cmd="$(which convert)"
if "${convert_cmd}" -list font | grep Font: | awk '{print($2)}' | grep font_name > /dev/null; then
return "${font_name}"
echo "${font_name}"
else
new_font_name="$("${convert_cmd}" -list font | grep Font: | awk '{print($2)}' |head -n 1)"
if [ "${new_font_name}" != "" ]; then
message "Couldn't find font '${font_name}' in the list from convert, so I'm using the first '${new_font_name}'"
return "${new_font_name}"
echo "${new_font_name}"
else
message "Error. No fonts available for convert!" p
exit 1