Skip to content

Commit

Permalink
close the file for windows file handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Feb 19, 2024
1 parent 3157403 commit 87794df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pkg/packager/sources/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func (s *SplitTarballSource) Collect(dir string) (string, error) {
if _, err = io.Copy(pkgFile, f); err != nil {
return "", fmt.Errorf("unable to copy file %s: %w", file, err)
}

// Close the file when done copying
err = f.Close()
if err != nil {
return "", fmt.Errorf("unable to close file %s: %w", file, err)
}
}

if err := utils.SHAsMatch(reassembled, pkgData.Sha256Sum); err != nil {
Expand Down

0 comments on commit 87794df

Please sign in to comment.