Skip to content

Commit

Permalink
Merge branch 'chisel-db-proxy' into chisel-db-report
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Feb 5, 2024
2 parents 6d111ac + 9ee449f commit d2227b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions internal/deb/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ func Extract(pkgReader io.Reader, options *ExtractOptions) (err error) {
if err != nil {
return err
}
validOpts := *options
if validOpts.Creator == nil {
validOpts.Creator = fsutil.NewCreator()
}

_, err = os.Stat(validOpts.TargetDir)
_, err = os.Stat(options.TargetDir)
if os.IsNotExist(err) {
return fmt.Errorf("target directory does not exist")
} else if err != nil {
Expand Down Expand Up @@ -104,7 +100,7 @@ func Extract(pkgReader io.Reader, options *ExtractOptions) (err error) {
dataReader = zstdReader
}
}
return extractData(dataReader, &validOpts)
return extractData(dataReader, options)
}

func extractData(dataReader io.Reader, options *ExtractOptions) error {
Expand Down
4 changes: 2 additions & 2 deletions internal/fsutil/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ func createSymlink(o *CreateOptions) error {
return os.Symlink(o.Link, o.Path)
}

// readerProxy implements the io.Reader interface proxying the calls to its inner io.Reader. On each read, the proxy
// calculates the file size and hash.
// readerProxy implements the io.Reader interface proxying the calls to its
// inner io.Reader. On each read, the proxy keeps track of the file size and hash.
type readerProxy struct {
inner io.Reader
h hash.Hash
Expand Down

0 comments on commit d2227b0

Please sign in to comment.