From 42541a717497fad430450147e438531aa1ab5802 Mon Sep 17 00:00:00 2001 From: Omar Ahmed Hassan Date: Mon, 16 Dec 2024 23:55:03 +0200 Subject: [PATCH] Rename LANGS variable in init.sh to avoid overriding font LANGS Rename LANGS variable in init.sh for TESSERACT_LANGS languages as it conflicts with the variable LANGS that is responsible for installing fonts --- scripts/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init.sh b/scripts/init.sh index b0e2a095..f839da2b 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -16,10 +16,10 @@ fi # Check if TESSERACT_LANGS environment variable is set and is not empty if [[ -n "$TESSERACT_LANGS" ]]; then # Convert comma-separated values to a space-separated list - LANGS=$(echo $TESSERACT_LANGS | tr ',' ' ') + SPACE_SEPARATED_LANGS=$(echo $TESSERACT_LANGS | tr ',' ' ') pattern='^[a-zA-Z]{2,4}(_[a-zA-Z]{2,4})?$' # Install each language pack - for LANG in $LANGS; do + for LANG in $SPACE_SEPARATED_LANGS; do if [[ $LANG =~ $pattern ]]; then apk add --no-cache "tesseract-ocr-data-$LANG" else