about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-05-14 17:27:11 +0200
committerAlan Pearce2024-05-14 17:27:11 +0200
commita94632eb788fd014bea0917a683896c44866f431 (patch)
treedfe8003f10ee24487998eaf7aa8c31f07649eb79
parentdf3b6bfd571c38aa7099838aa43bb3aff0eff2bf (diff)
downloadsearchix-a94632eb788fd014bea0917a683896c44866f431.tar.lz
searchix-a94632eb788fd014bea0917a683896c44866f431.tar.zst
searchix-a94632eb788fd014bea0917a683896c44866f431.zip
fix(importer): don't create duplicate nested directories
-rw-r--r--internal/importer/importer.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/internal/importer/importer.go b/internal/importer/importer.go
index c50a72b..0768656 100644
--- a/internal/importer/importer.go
+++ b/internal/importer/importer.go
@@ -3,7 +3,6 @@ package importer
 import (
 	"context"
 	"log/slog"
-	"path"
 	"searchix/internal/config"
 	"searchix/internal/index"
 	"sync"
@@ -19,10 +18,8 @@ func NewNixpkgsChannelImporter(
 	dataPath string,
 	logger *slog.Logger,
 ) *NixpkgsChannelImporter {
-	fullpath := path.Join(dataPath, source.Channel)
-
 	return &NixpkgsChannelImporter{
-		DataPath: fullpath,
+		DataPath: dataPath,
 		Source:   source,
 		Logger:   logger,
 	}
@@ -33,10 +30,8 @@ func NewChannelImporter(
 	dataPath string,
 	logger *slog.Logger,
 ) *ChannelImporter {
-	fullpath := path.Join(dataPath, source.Channel)
-
 	return &ChannelImporter{
-		DataPath: fullpath,
+		DataPath: dataPath,
 		Source:   source,
 		Logger:   logger,
 	}
@@ -47,10 +42,8 @@ func NewDownloadOptionsImporter(
 	dataPath string,
 	logger *slog.Logger,
 ) *DownloadOptionsImporter {
-	fullpath := path.Join(dataPath, source.Channel)
-
 	return &DownloadOptionsImporter{
-		DataPath: fullpath,
+		DataPath: dataPath,
 		Source:   source,
 		Logger:   logger,
 	}