all repos — searchix @ 1aa991ae1f1a426424549c92060b204114c8b3c2

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

refactor: deduce index path automatically from config.DataPath

Alan Pearce
commit

1aa991ae1f1a426424549c92060b204114c8b3c2

parent

48423548f4718886d32a87ddd65d5ee2620fd8c8

1 file changed, 9 insertions(+), 14 deletions(-)

changed files
M internal/importer/importer.gointernal/importer/importer.go
@@ -32,34 +32,29 @@ source *Source,
dataPath string, logger *slog.Logger, ) *NixpkgsChannelImporter { - indexPath := dataPath fullpath := path.Join(dataPath, source.Channel) return &NixpkgsChannelImporter{ - DataPath: fullpath, - Source: source, - Logger: logger, - indexPath: indexPath, + DataPath: fullpath, + Source: source, + Logger: logger, } } func NewChannelImporter(source *Source, dataPath string, logger *slog.Logger) *ChannelImporter { - indexPath := dataPath fullpath := path.Join(dataPath, source.Channel) return &ChannelImporter{ - DataPath: fullpath, - Source: source, - Logger: logger, - indexPath: indexPath, + DataPath: fullpath, + Source: source, + Logger: logger, } } type importConfig struct { - IndexPath string - Filename string - Source *Source - Logger *slog.Logger + Filename string + Source *Source + Logger *slog.Logger } func processOptions(