Skip to content

Commit

Permalink
pack fix file modes
Browse files Browse the repository at this point in the history
  • Loading branch information
permui committed Oct 7, 2022
1 parent 7057997 commit cdabdfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/targz.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func AddToArchive(tw *tar.Writer, filename string) error {
return err
}

info.Mode()

// Create a tar Header from the FileInfo data
header, err := tar.FileInfoHeader(info, info.Name())
if err != nil {
Expand All @@ -75,6 +77,7 @@ func AddToArchive(tw *tar.Writer, filename string) error {
// not be preserved
// https://golang.org/src/archive/tar/common.go?#L626
header.Name = filename
header.Mode = 0644

// Write file header to the tar archive
err = tw.WriteHeader(header)
Expand Down

0 comments on commit cdabdfa

Please sign in to comment.