1
0
mirror of https://github.com/beego/bee.git synced 2025-06-11 18:40:40 +00:00

print lastPushedTime & update readme.md

This commit is contained in:
wangle
2020-09-14 23:27:33 +08:00
parent 81ed06ea01
commit 7a7357a983
9 changed files with 230 additions and 110 deletions

View File

@ -8,6 +8,7 @@ import (
"github.com/beego/bee/cmd/commands"
"github.com/beego/bee/config"
beeLogger "github.com/beego/bee/logger"
"github.com/beego/bee/utils"
)
var CmdUpdate = &commands.Command{
@ -32,7 +33,9 @@ func updateBee(cmd *commands.Command, args []string) int {
cmdUp.Stdout = os.Stdout
cmdUp.Stderr = os.Stderr
if err := cmdUp.Run(); err != nil {
beeLogger.Log.Warnf("Run cmd err:%s",err)
beeLogger.Log.Warnf("Run cmd err:%s", err)
}
// update the pushedTime when updateBee every time
utils.UpdateLastPushedTime()
return 0
}

View File

@ -10,6 +10,7 @@ import (
"time"
beeLogger "github.com/beego/bee/logger"
"github.com/beego/bee/utils"
)
// RuntimeInfo holds information about the current runtime.
@ -23,6 +24,7 @@ type RuntimeInfo struct {
Compiler string
BeeVersion string
BeegoVersion string
UpdatedAt string
}
// InitBanner loads the banner and prints it to output
@ -60,6 +62,7 @@ func show(out io.Writer, content string) {
runtime.Compiler,
version,
GetBeegoVersion(),
utils.GetLastPushedTime(),
})
if err != nil {
beeLogger.Log.Error(err.Error())

View File

@ -38,7 +38,7 @@ const verboseVersionBanner string = `%s%s______
├── GOPATH : {{ .GOPATH }}
├── GOROOT : {{ .GOROOT }}
├── Compiler : {{ .Compiler }}
└── Date : {{ Now "Monday, 2 Jan 2006" }}%s
└── UpdatedAt : {{ .UpdatedAt }}%s
`
const shortVersionBanner = `______
@ -84,6 +84,7 @@ func versionCmd(cmd *commands.Command, args []string) int {
runtime.Compiler,
version,
GetBeegoVersion(),
utils.GetLastPushedTime(),
}
switch outputFormat {
case "json":