fix: coco version
This commit is contained in:
parent
f656fdfce8
commit
bdc3dc9077
|
@ -2,6 +2,7 @@ package bootstrap
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -25,7 +26,7 @@ func AddVersionCommand() *cobra.Command {
|
||||||
}
|
}
|
||||||
configPath = rt.ReplaceEachSlash(fmt.Sprintf("%s/.coco.yaml", rt.GetHomeDir()))
|
configPath = rt.ReplaceEachSlash(fmt.Sprintf("%s/.coco.yaml", rt.GetHomeDir()))
|
||||||
_ = easyaml.Read(configPath, &config)
|
_ = 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) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
client, err := NewGiteaClient("https://gitter.top")
|
client, err := NewGiteaClient("https://gitter.top")
|
||||||
|
@ -44,7 +45,7 @@ func AddVersionCommand() *cobra.Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
var commitID = commit.SHA[:8]
|
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 {
|
if update {
|
||||||
repo := fmt.Sprintf("gitter.top/coco/bootstrap/coco/...@%s", commitID)
|
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
|
return cmd
|
||||||
}
|
}
|
Loading…
Reference in New Issue