mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
hugofs: Set modTime at creation time
As `ModTime()` should return the same value on each invocation. See #6161
This commit is contained in:
parent
26ae12c0c6
commit
06d295427f
1 changed files with 4 additions and 3 deletions
|
@ -264,7 +264,8 @@ func mergeFileMeta(from, to FileMeta) {
|
|||
}
|
||||
|
||||
type dirNameOnlyFileInfo struct {
|
||||
name string
|
||||
name string
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi *dirNameOnlyFileInfo) Name() string {
|
||||
|
@ -280,7 +281,7 @@ func (fi *dirNameOnlyFileInfo) Mode() os.FileMode {
|
|||
}
|
||||
|
||||
func (fi *dirNameOnlyFileInfo) ModTime() time.Time {
|
||||
return time.Now()
|
||||
return fi.modTime
|
||||
}
|
||||
|
||||
func (fi *dirNameOnlyFileInfo) IsDir() bool {
|
||||
|
@ -303,7 +304,7 @@ func newDirNameOnlyFileInfo(name string, meta FileMeta, fileOpener func() (afero
|
|||
m[metaKeyIsOrdered] = false
|
||||
|
||||
return NewFileMetaInfo(
|
||||
&dirNameOnlyFileInfo{name: base},
|
||||
&dirNameOnlyFileInfo{name: base, modTime: time.Now()},
|
||||
m,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue