File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/gohugoio/hugoreleaser-archive-plugins/deb
33go 1.19
44
55require (
6- github.com/gohugoio/hugoreleaser-plugins-api v0.5 .0
6+ github.com/gohugoio/hugoreleaser-plugins-api v0.6 .0
77 github.com/goreleaser/nfpm/v2 v2.18.1
88)
99
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
6262github.com/gobwas/glob v0.2.3 /go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8 =
6363github.com/gohugoio/hugoreleaser-plugins-api v0.5.0 h1:/jroeaa+w2q2ikeTiG8x7r721FbaWhvSrAM7uPFV7Ko =
6464github.com/gohugoio/hugoreleaser-plugins-api v0.5.0 /go.mod h1:DZbhdQL7/zopVHtEBJqWXOtscstfmbo9CAEIbG6tdd0 =
65+ github.com/gohugoio/hugoreleaser-plugins-api v0.6.0 h1:U6cH8JKl/GhcThtFfsoIVOVSNq+iqZNGtUlnXnlxfKA =
66+ github.com/gohugoio/hugoreleaser-plugins-api v0.6.0 /go.mod h1:DZbhdQL7/zopVHtEBJqWXOtscstfmbo9CAEIbG6tdd0 =
6567github.com/google/go-cmp v0.3.0 /go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU =
6668github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg =
6769github.com/google/rpmpack v0.0.0-20220314092521-38642b5e571e h1:6Jn9JtfCn20uycra92LxTkq5yfBKNSFlRJPBk8/Cxhg =
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ package main
1616
1717import (
1818 "io"
19+ "io/fs"
1920 "log"
2021 "os"
2122 "path/filepath"
@@ -86,12 +87,12 @@ type debArchivist struct {
8687 settings Settings
8788}
8889
89- func (a * debArchivist ) Add (sourceFilename , targetPath string ) error {
90+ func (a * debArchivist ) Add (sourceFilename , targetPath string , mode fs. FileMode ) error {
9091 a .files = append (a .files , & files.Content {
9192 Source : filepath .ToSlash (sourceFilename ),
9293 Destination : targetPath ,
9394 FileInfo : & files.ContentFileInfo {
94- Mode : 0o755 ,
95+ Mode : mode ,
9596 },
9697 })
9798
@@ -160,7 +161,10 @@ func createArchive(req archiveplugin.Request) error {
160161 }
161162
162163 for _ , file := range req .Files {
163- archivist .Add (file .SourcePathAbs , file .TargetPath )
164+ if file .Mode == 0 {
165+ file .Mode = 0644
166+ }
167+ archivist .Add (file .SourcePathAbs , file .TargetPath , file .Mode )
164168 }
165169
166170 return archivist .Finalize ()
You can’t perform that action at this time.
0 commit comments