diff options
| author | Paul Buetow <paul@buetow.org> | 2024-11-06 11:11:34 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-11-06 11:11:34 +0200 |
| commit | 2d652249ca36219853b34d9f55101ed3cbd109a1 (patch) | |
| tree | b95562d42c98cff62f1c68e6a20b116614819815 /internal/queue/queue.go | |
| parent | 3551fd060242b5c0ca07d4cc371b1032d0983e38 (diff) | |
initial inline tag support
Diffstat (limited to 'internal/queue/queue.go')
| -rw-r--r-- | internal/queue/queue.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 87aae65..9d846e0 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -35,21 +35,26 @@ func queueEntries(args config.Args) error { } for filePath := range ch { - ent, err := entry.New(filePath) + en, err := entry.New(filePath) if err != nil { return err } - if ent.HasTag("ask") { - if err := ent.FileAction("Do you want to queue this content"); err != nil { + // Extract any inline tags, if any! + if err := en.ExtractInlineTags(); err != nil { + return err + } + if en.HasTag("ask") { + // TODO: Handle inline tags + if err := en.FileAction("Do you want to queue this content"); err != nil { return err } } - destPath := fmt.Sprintf("%s/db/%s.%s.queued", args.GosDir, filepath.Base(ent.Path), timestamp.Now()) + destPath := fmt.Sprintf("%s/db/%s.%s.queued", args.GosDir, filepath.Base(en.Path), timestamp.Now()) if args.DryRun { - log.Println("Not queueing entry", ent.Path, "to", destPath, "as dry-run mode enabled") + log.Println("Not queueing entry", en.Path, "to", destPath, "as dry-run mode enabled") continue } - if err := oi.Rename(ent.Path, destPath); err != nil { + if err := oi.Rename(en.Path, destPath); err != nil { return err } } |
