about summary refs log tree commit diff stats
path: root/import/main.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-11 14:41:00 +0200
committerAlan Pearce2024-05-11 14:41:00 +0200
commitdbe952d1df63522e5c32b4ef3e59c43886ba9257 (patch)
tree36fecbc0a1d53e8f8437ace333dc848e65cbc80e /import/main.go
parent1aa991ae1f1a426424549c92060b204114c8b3c2 (diff)
downloadsearchix-dbe952d1df63522e5c32b4ef3e59c43886ba9257.tar.lz
searchix-dbe952d1df63522e5c32b4ef3e59c43886ba9257.tar.zst
searchix-dbe952d1df63522e5c32b4ef3e59c43886ba9257.zip
refactor: move sources input data to $data_root/sources
Diffstat (limited to 'import/main.go')
-rw-r--r--import/main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/import/main.go b/import/main.go
index 90f2b74..0bff7ab 100644
--- a/import/main.go
+++ b/import/main.go
@@ -64,11 +64,13 @@ func main() {
 		logger := slog.With("name", name, "importer", source.Type.String())
 		logger.Debug("starting importer")
 
+		importerDataPath := path.Join(cfg.DataPath, "sources", source.Channel)
+
 		switch source.Type {
 		case importer.ChannelNixpkgs:
-			imp = importer.NewNixpkgsChannelImporter(source, cfg.DataPath, logger)
+			imp = importer.NewNixpkgsChannelImporter(source, importerDataPath, logger)
 		case importer.Channel:
-			imp = importer.NewChannelImporter(source, cfg.DataPath, logger)
+			imp = importer.NewChannelImporter(source, importerDataPath, logger)
 		default:
 			log.Printf("unsupported importer type %s", source.Type.String())