Merge pull request #2468 from omar-ahmed42/fix-langs-env-override

Fix: Rename LANGS variable in init.sh to avoid clashing with LANGS env
This commit is contained in:
Anthony Stirling 2024-12-16 22:41:13 +00:00 committed by GitHub
commit e273b9a3ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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