Corrections to pass pre-commit hooks

This commit is contained in:
Schnuffle
2022-03-20 15:58:37 +01:00
parent 9a8af04931
commit 81c16f6bc0
15 changed files with 49 additions and 43 deletions

View File

@@ -56,12 +56,12 @@ install_languages() {
# continue
#fi
if dpkg -s $pkg &>/dev/null; then
if dpkg -s "$pkg" &>/dev/null; then
echo "Package $pkg already installed!"
continue
fi
if ! apt-cache show $pkg &>/dev/null; then
if ! apt-cache show "$pkg" &>/dev/null; then
echo "Package $pkg not found! :("
continue
fi
@@ -77,7 +77,7 @@ install_languages() {
echo "Paperless-ngx docker container starting..."
# Install additional languages if specified
if [[ ! -z "$PAPERLESS_OCR_LANGUAGES" ]]; then
if [[ -n "$PAPERLESS_OCR_LANGUAGES" ]]; then
install_languages "$PAPERLESS_OCR_LANGUAGES"
fi

View File

@@ -6,14 +6,11 @@ wait_for_postgres() {
echo "Waiting for PostgreSQL to start..."
host="${PAPERLESS_DBHOST}"
port="${PAPERLESS_DBPORT}"
host="${PAPERLESS_DBHOST:=localhost}"
port="${PAPERLESS_DBPORT:=5342}"
if [[ -z $port ]]; then
port="5432"
fi
while ! </dev/tcp/$host/$port; do
while [ ! "$(pg_isready -h "$host" -p "$port")" ]; do
if [ $attempt_num -eq $max_attempts ]; then
echo "Unable to connect to database."
@@ -23,7 +20,7 @@ wait_for_postgres() {
fi
attempt_num=$(expr "$attempt_num" + 1)
attempt_num=$(("$attempt_num" + 1))
sleep 5
done
}

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
for command in document_archiver document_exporter document_importer mail_fetcher document_create_classifier document_index document_renamer document_retagger document_thumbnails document_sanity_checker manage_superuser;
do
echo "installing $command..."

View File

@@ -6,10 +6,10 @@ cd /usr/src/paperless/src/
if [[ $(id -u) == 0 ]] ;
then
gosu paperless python3 manage.py management_command "$@"
gosu paperless python3 manage.py management_command "$@"
elif [[ $(id -un) == "paperless" ]] ;
then
python3 manage.py management_command "$@"
python3 manage.py management_command "$@"
else
echo "Unknown user."
echo "Unknown user."
fi