all repos — searchix @ b8da487f774aa2399b79bbde5f2e6e13be4fce1c

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

feat: decode brotli-compressed files

Alan Pearce
commit

b8da487f774aa2399b79bbde5f2e6e13be4fce1c

parent

27b07a80f1872205dfeb949e9b90cf85f6e43744

1 file changed, 3 insertions(+), 7 deletions(-)

changed files
M internal/importer/options.gointernal/importer/options.go
@@ -2,8 +2,8 @@ package importer
import ( "context" + "io" "log/slog" - "os" "reflect" "searchix/internal/config" "searchix/internal/nix"
@@ -58,15 +58,11 @@ type OptionIngester struct {
dec *jstream.Decoder ms *mapstructure.Decoder optJSON nixOptionJSON - infile *os.File + infile io.ReadCloser source *config.Source } -func NewOptionProcessor(inpath string, source *config.Source) (*OptionIngester, error) { - infile, err := os.Open(inpath) - if err != nil { - return nil, errors.WithMessagef(err, "failed to open input file %s", inpath) - } +func NewOptionProcessor(infile io.ReadCloser, source *config.Source) (*OptionIngester, error) { i := OptionIngester{ dec: jstream.NewDecoder(infile, 1).EmitKV(), optJSON: nixOptionJSON{},