forked from EhsanKia/CatalogScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·48 lines (38 loc) · 1.25 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/sh
set -e
function color_echo {
echo -e "\033[1;32m$1\033[0m"
}
function warning_echo {
echo -e "\033[1;33m$1\033[0m"
}
if [ -f /etc/os-release ]; then
source /etc/os-release
else
warning_echo "Could not determine the OS distribution."
ID="unknown"
fi
color_echo "Distribution ID: $ID"
function arch_install_tesseract {
# Install the required packages
color_echo "Installing Tesseract OCR dependencies..."
sudo pacman -Sy --needed $(cat pacman-deps.txt)
# Install Tesseract OCR Script
if [ ! -f /usr/share/tessdata/script/Latin.traineddata ]; then
echo "Downloading Latin traineddata..."
sudo mkdir -p /usr/share/tessdata/script
sudo curl "https://raw.githubusercontent.com/tesseract-ocr/tessdata/main/script/Latin.traineddata" -o /usr/share/tessdata/script/Latin.traineddata
fi
}
# Check if the OS is Arch Linux
if [ "$ID" == "arch" ]; then
arch_install_tesseract
else
warning_echo "Only Arch Linux is supported for installing tesseract dependencies. Please install the required packages manually."
fi
# Install python packages
color_echo "Installing Python packages..."
poetry install
# Install pre-commit hooks
color_echo "Installing pre-commit hooks..."
poetry run pre-commit install