1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-23 04:51:15 +01:00
gojekyll/commands/version.go

19 lines
368 B
Go
Raw Normal View History

2017-07-19 16:06:43 -04:00
package commands
2017-07-05 11:18:46 -04:00
2017-07-18 09:34:54 -04:00
import (
"fmt"
2017-08-14 15:23:00 -04:00
"github.com/osteele/gojekyll/version"
2017-07-18 09:34:54 -04:00
)
2017-07-05 11:18:46 -04:00
2017-08-11 13:25:51 -04:00
var versionCmd = app.Command("version", "Print the name and version")
func versionCommand() error {
var d string
2017-08-14 15:23:00 -04:00
if !version.BuildTime.IsZero() {
d = version.BuildTime.Format(" (Build time: 2006-01-02T15:04)")
2017-08-11 13:25:51 -04:00
}
2017-08-14 15:23:00 -04:00
fmt.Printf("gojekyll version %s%s\n", version.Version, d)
2017-08-11 13:25:51 -04:00
return nil
}