From a94632eb788fd014bea0917a683896c44866f431 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 14 May 2024 17:27:11 +0200 Subject: fix(importer): don't create duplicate nested directories --- internal/importer/importer.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'internal/importer/importer.go') 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, } -- cgit 1.4.1