Compare commits

...

2 Commits

Author SHA1 Message Date
Lukáš Kucharczyk 69951be543
Pass on --db to the autoimport command 2022-11-18 14:05:31 +01:00
Lukáš Kucharczyk b483c72df7
Handle ~ in --db argument 2022-11-18 14:05:06 +01:00
1 changed files with 2 additions and 2 deletions

4
tag.sh
View File

@ -21,7 +21,7 @@ SCRIPT_NAME=$(basename "$0")
DB_FILE="${PWD}/tags.db"
[ "${1:-}" = "--db" ] && DB_FILE="$2" && shift 2
[ "${1:-}" = "--db" ] && DB_FILE=$(realpath "${2/#~/$HOME}") && shift 2
DB_SCHEMA="${SCRIPT_DIR}/database.sql"
@ -173,7 +173,7 @@ add_hash() {
add_path_auto() {
# $REGEX $FOLDER
find "${2}" -type f -regextype posix-extended -iregex "$1" -exec "$0" import "{}" +
find "${2}" -type f -regextype posix-extended -iregex "$1" -exec "$0" --db "$DB_FILE" import "{}" +
}
tag_exists_in_db() {