From bdc3dc907749e2e64339e0457b6592148a694fd7 Mon Sep 17 00:00:00 2001 From: Young Xu Date: Sat, 6 Apr 2024 12:48:27 +0800 Subject: [PATCH] fix: coco version --- coco_update.go => coco_version.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename coco_update.go => coco_version.go (90%) diff --git a/coco_update.go b/coco_version.go similarity index 90% rename from coco_update.go rename to coco_version.go index a6119d7..7af2e25 100644 --- a/coco_update.go +++ b/coco_version.go @@ -2,6 +2,7 @@ package bootstrap import ( "fmt" + "time" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -25,7 +26,7 @@ func AddVersionCommand() *cobra.Command { } configPath = rt.ReplaceEachSlash(fmt.Sprintf("%s/.coco.yaml", rt.GetHomeDir())) _ = easyaml.Read(configPath, &config) - logrus.Infof("current version: %s, release at: %s", config.Version, config.CommitAt) + logrus.Infof("current version: %s, release at: %s", config.Version, config.CommitAt.Format(time.DateTime)) }, Run: func(cmd *cobra.Command, args []string) { client, err := NewGiteaClient("https://gitter.top") @@ -44,7 +45,7 @@ func AddVersionCommand() *cobra.Command { } var commitID = commit.SHA[:8] - logrus.Infof("latest version: %s, release at: %s", commitID, commit.CommitMeta.Created) + logrus.Infof("latest version: %s, release at: %s", commitID, commit.CommitMeta.Created.Format(time.DateTime)) if update { repo := fmt.Sprintf("gitter.top/coco/bootstrap/coco/...@%s", commitID) @@ -63,6 +64,6 @@ func AddVersionCommand() *cobra.Command { } }, } - cmd.Flags().BoolVar(&update, "update", true, "update coco version") + cmd.Flags().BoolVar(&update, "update", false, "update coco version") return cmd }