fix(importer): don't create duplicate nested directories
Alan Pearce alan@alanpearce.eu
Tue, 14 May 2024 17:27:11 +0200
1 files changed, 3 insertions(+), 10 deletions(-)
M internal/importer/importer.go → internal/importer/importer.go
@@ -3,7 +3,6 @@ import ( "context" "log/slog" - "path" "searchix/internal/config" "searchix/internal/index" "sync" @@ -19,10 +18,8 @@ source *config.Source, 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 @@ source *config.Source, 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 @@ source *config.Source, dataPath string, logger *slog.Logger, ) *DownloadOptionsImporter { - fullpath := path.Join(dataPath, source.Channel) - return &DownloadOptionsImporter{ - DataPath: fullpath, + DataPath: dataPath, Source: source, Logger: logger, }