~emersion/hut-dev

export/todo: Skip tracker if dump already exists v1 APPLIED

Thorben Günther: 1
 export/todo: Skip tracker if dump already exists

 1 files changed, 5 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/hut-dev/patches/43731/mbox | git am -3
Learn more about email & git

[PATCH] export/todo: Skip tracker if dump already exists Export this patch

---
 export/todo.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/export/todo.go b/export/todo.go
index dadd214..4512faf 100644
--- a/export/todo.go
+++ b/export/todo.go
@@ -71,6 +71,11 @@ func (ex *TodoExporter) Export(ctx context.Context, dir string) error {

func (ex *TodoExporter) exportTracker(ctx context.Context, tracker todosrht.Tracker, base string) error {
	infoPath := path.Join(base, infoFilename)
	if _, err := os.Stat(infoPath); err == nil {
		log.Printf("\tSkipping %s (already exists)", tracker.Name)
		return nil
	}

	dataPath := path.Join(base, "tracker.json.gz")
	log.Printf("\t%s", tracker.Name)
	if err := os.MkdirAll(base, 0o755); err != nil {

base-commit: d38890e3b652d21f7867317b3aa9013d59422088
prerequisite-patch-id: c89d1829563c41db0a6b40cee395fac5126a07fe
--
2.41.0
Pushed, thanks!