feat: add --update flag to force-update index and exit
Alan Pearce alan@alanpearce.eu
Mon, 20 May 2024 23:07:25 +0200
2 files changed, 6 insertions(+), 2 deletions(-)
jump to
M searchix.go → searchix.go
@@ -31,6 +31,7 @@ "print default configuration and exit", ) liveReload = flag.Bool("live", false, "whether to enable live reloading (development)") replace = flag.Bool("replace", false, "replace existing index and exit") + update = flag.Bool("update", false, "update index and exit") version = flag.Bool("version", false, "print version information") ) @@ -111,13 +112,13 @@ if err != nil { log.Fatalf("Failed to open or create index: %v", err) } - if !exists || *replace { + if !exists || *replace || *update { slog.Info("Index doesn't exist. Starting build job...") err = importer.Start(cfg, write, *replace, nil) if err != nil { log.Fatalf("Failed to build index: %v", err) } - if *replace { + if *replace || *update { return } } else {