tagger.sh: allow tagging existing files
This commit is contained in:
parent
07590582d6
commit
378d91ca0e
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# wrapper over tmsu for easy tagging
|
# wrapper over tmsu for easy tagging
|
||||||
# tags untagged files for the database in the current working directory
|
# tags untagged files for the database in the current working directory
|
||||||
|
# or pipe in a list of files to tag
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -60,7 +61,11 @@ appendargs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INPUT_FILE="$(mktemp)"
|
INPUT_FILE="$(mktemp)"
|
||||||
tmsu untagged > "$INPUT_FILE"
|
if [ -t 0 ]; then
|
||||||
|
tmsu untagged > "$INPUT_FILE"
|
||||||
|
else
|
||||||
|
cat /dev/stdin > "$INPUT_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
# this seems to magically fix some tmsu issue i don't really understand
|
# this seems to magically fix some tmsu issue i don't really understand
|
||||||
# tmsu freezes for a second or two
|
# tmsu freezes for a second or two
|
||||||
@ -71,7 +76,10 @@ while read -r FILE; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
tmsu tags -1 "$FILE" | tail -n+2 > "$TMSU_ARGS"
|
||||||
|
|
||||||
view "$FILE"
|
view "$FILE"
|
||||||
|
|
||||||
appendargs
|
appendargs
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
Loading…
Reference in New Issue
Block a user