diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-06-27 18:00:20 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-06-27 18:00:20 +0200 |
commit | 6cd2110ab295f598907a18da91e34d31407c1d9d (patch) | |
tree | 35d82731db58664b810133eb764cb8ca54223f73 /modules/module.go | |
parent | 6a365c2712c7607e067e192d213b266f0c88d0f3 (diff) | |
download | hugo-6cd2110ab295f598907a18da91e34d31407c1d9d.tar.gz hugo-6cd2110ab295f598907a18da91e34d31407c1d9d.zip |
commands: Add version time to "hugo config mounts"
Diffstat (limited to 'modules/module.go')
-rw-r--r-- | modules/module.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/module.go b/modules/module.go index c3343c820..a6feaab73 100644 --- a/modules/module.go +++ b/modules/module.go @@ -17,6 +17,8 @@ package modules import ( + "time" + "github.com/gohugoio/hugo/config" ) @@ -65,6 +67,9 @@ type Module interface { // The module version. Version() string + // Time version was created. + Time() *time.Time + // Whether this module's dir is a watch candidate. Watch() bool } @@ -154,6 +159,14 @@ func (m *moduleAdapter) Version() string { return m.gomod.Version } +func (m *moduleAdapter) Time() *time.Time { + if !m.IsGoMod() || m.gomod.Time == nil { + return nil + } + + return m.gomod.Time +} + func (m *moduleAdapter) Watch() bool { if m.Owner() == nil { // Main project |