From 634805d36d5196880d3b7f9b5ce7bc4f3ab7b1f9 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:17:54 -0400 Subject: [PATCH] fix: ocr file not found errors --- modules/common/shell/bash/scripts/ocr.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/common/shell/bash/scripts/ocr.sh b/modules/common/shell/bash/scripts/ocr.sh index 313a069..1d45bfd 100755 --- a/modules/common/shell/bash/scripts/ocr.sh +++ b/modules/common/shell/bash/scripts/ocr.sh @@ -31,6 +31,10 @@ STATUS=$? # because tesseract adds .txt to the given file path anyways. So if we were to # specify /tmp/ocr.txt as the file path, tesseract would out the text to # /tmp/ocr.txt.txt +cd /tmp || { + echo "Failed to jump to directory." + exit 1 +} tesseract "$IMAGE_FILE" "${TEXT_FILE//\.txt/}" # Check if the text was detected by checking number