Allow specifying different database for all commands

This commit is contained in:
Lukáš Kucharczyk 2022-11-16 08:00:00 +01:00
parent 4761ef5040
commit 70ea680b0f
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 8 additions and 1 deletions

9
tag.sh
View File

@ -18,7 +18,14 @@ set -ueo pipefail
# FIXME: adding tags doesn't work
SCRIPT_DIR=$(dirname $(readlink "$0"))
DB_FILE="tags.db"
CURRENT_DIR=$(dirname "$PWD")
SCRIPT_NAME=$(basename "$0")
DB_FILE="${CURRENT_DIR}/tags.db"
[ "$1" = "--db" ] && DB_FILE="$2" && shift 2
DB_SCHEMA="${SCRIPT_DIR}/database.sql"
declare -A FILTERS
FILTERS[video]="avi|flv|mkv|mov|mp4|mpg|ogv|webm|wmv"