mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -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 {
|
type dirNameOnlyFileInfo struct {
|
||||||
name string
|
name string
|
||||||
|
modTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi *dirNameOnlyFileInfo) Name() string {
|
func (fi *dirNameOnlyFileInfo) Name() string {
|
||||||
|
@ -280,7 +281,7 @@ func (fi *dirNameOnlyFileInfo) Mode() os.FileMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi *dirNameOnlyFileInfo) ModTime() time.Time {
|
func (fi *dirNameOnlyFileInfo) ModTime() time.Time {
|
||||||
return time.Now()
|
return fi.modTime
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi *dirNameOnlyFileInfo) IsDir() bool {
|
func (fi *dirNameOnlyFileInfo) IsDir() bool {
|
||||||
|
@ -303,7 +304,7 @@ func newDirNameOnlyFileInfo(name string, meta FileMeta, fileOpener func() (afero
|
||||||
m[metaKeyIsOrdered] = false
|
m[metaKeyIsOrdered] = false
|
||||||
|
|
||||||
return NewFileMetaInfo(
|
return NewFileMetaInfo(
|
||||||
&dirNameOnlyFileInfo{name: base},
|
&dirNameOnlyFileInfo{name: base, modTime: time.Now()},
|
||||||
m,
|
m,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue