all repos — searchix @ 001c5b4f4e6dcf0110504211d3f1298d5e6abc48

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: add --fetch action to populate data/sources

Alan Pearce
commit

001c5b4f4e6dcf0110504211d3f1298d5e6abc48

parent

a49d405f81ed9b872ae638832f3a1a5f2339780c

1 file changed, 4 insertions(+), 3 deletions(-)

changed files
M cmd/searchix-web/main.gocmd/searchix-web/main.go
@@ -35,6 +35,7 @@ )
generateErrorPage = flag.Bool("generate-error-page", false, "generate error page and exit") dev = flag.Bool("dev", false, "enable live reloading and nicer logging") replace = flag.Bool("replace", false, "replace existing index and exit") + fetch = flag.Bool("fetch", false, "fetch data and exit") version = flag.Bool("version", false, "print version information") cpuprofile = flag.String("cpuprofile", "", "enable CPU profiling and save to `file`") )
@@ -144,13 +145,13 @@ if err != nil {
logger.Fatal("Failed to create importer", "error", err) } - if !exists || *replace { - err := imp.Start(ctx, true, nil) + if !exists || *replace || *fetch { + err := imp.Start(ctx, true, *fetch, nil) if err != nil { logger.Fatal("Failed to start importer", "error", err) } - if *replace { + if *replace || *fetch { return } }