1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-06 04:36:16 +02:00

fix: honor SOURCE_DATE_EPOCH for files (#775)

If set, SOURCE_DATE_EPOCH will be honored for all content entries.
This commit is contained in:
Oscar Linderholm 2024-01-30 11:59:30 +01:00 committed by GitHub
parent 25f6f2b736
commit e1ebfdad10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ func (c *Content) WithFileInfoDefaults(umask fs.FileMode, mtime time.Time) *Cont
if (cc.Type == TypeDir || cc.Type == TypeImplicitDir) && cc.FileInfo.Mode == 0 {
cc.FileInfo.Mode = 0o755
}
if (cc.Type == TypeDir || cc.Type == TypeImplicitDir) && cc.FileInfo.MTime.IsZero() {
if cc.FileInfo.MTime.IsZero() {
cc.FileInfo.MTime = mtime
}

View File

@ -160,7 +160,7 @@ contents:
require.Equal(t, "files_test.go", f.Source)
require.Equal(t, "/b", f.Destination)
require.Equal(t, f.FileInfo.Mode, fi.Mode())
require.Equal(t, f.FileInfo.MTime, fi.ModTime())
require.Equal(t, f.FileInfo.MTime, mtime)
}
func TestFileInfo(t *testing.T) {