mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-13 20:24:00 +02:00
commands: Add version time to "hugo config mounts"
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user