Skip to content

Commit

Permalink
fix(index): close file before sign
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Pablo Calisi <calisi.lucas@gmail.com>
  • Loading branch information
lpcalisi committed May 22, 2024
1 parent c31490a commit 6748410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/index/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ func (idx *Index) WriteArchiveIndex(ctx context.Context, destinationFile string)
if err != nil {
return fmt.Errorf("failed to create archive file: %w", err)
}
defer outFile.Close()

if _, err = io.Copy(outFile, archive); err != nil {
return fmt.Errorf("failed to write contents to archive file: %w", err)
}
outFile.Close()

if idx.SigningKey != "" {
log.Infof("signing apk index at %s", idx.IndexFile)
Expand Down

0 comments on commit 6748410

Please sign in to comment.