Browse Source

bin/tagger.sh: list files to tag, display already-tagged

Brennen Bearnes 3 months ago
parent
commit
89a311bbb3
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      bin/tagger.sh

+ 5
- 2
bin/tagger.sh View File

@@ -4,7 +4,7 @@
4 4
 # and prompt for space-separated tags to add.  pretty fucking stupid, use with
5 5
 # caution.
6 6
 
7
-entrylist=`mktemp /tmp/entrylist.XXXX`
7
+entrylist=$(mktemp /tmp/entrylist.XXXX)
8 8
 
9 9
 # allow cycling through inputs, create a preview window with file contents,
10 10
 # use n and p to move up and down in preview window:
@@ -18,6 +18,9 @@ blacklist="topics|hack"
18 18
 
19 19
 ack -il "$@" ./archives | sort -n | uniq | egrep -v "$blacklist" | fzf > "$entrylist"
20 20
 
21
+echo "tagging:"
22
+cat "$entrylist"
23
+
21 24
 # get a list of tags to apply:
22 25
 echo -n "enter tags (space-separated): "
23 26
 read tags
@@ -28,7 +31,7 @@ while read entry; do
28 31
   entry="${entry%/index}"
29 32
 
30 33
   for tag in $tags; do
31
-    if [ -e "${entry}/$tag" ]; then
34
+    if [ -e "${entry}/tag-$tag.prop" ]; then
32 35
       echo "$entry already tagged"
33 36
     else
34 37
       wrt addprop "$entry" "tag-$tag"

Loading…
Cancel
Save