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