This commit is contained in:
david 2024-03-02 15:59:23 +08:00
parent 4775d71e04
commit 3a8f8f083c
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ type LocalServices struct {
var checkCmd = &cobra.Command{ var checkCmd = &cobra.Command{
Use: "check", Use: "check",
Short: "check microservice.", Short: "check etc/service/registry auto version update or install.",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 { if len(args) != 1 {
fmt.Println("Please input the name of the microservice to be updated!") fmt.Println("Please input the name of the microservice to be updated!")

View File

@ -16,13 +16,13 @@ func init() {
// get os env. // get os env.
env.NewEnv() env.NewEnv()
psCmd.Flags().StringVarP(&registryUrl, "registry", "r", "", "registry url.") rootCmd.Flags().StringVarP(&registryUrl, "registry", "r", "", "registry server url.")
if registryUrl == "" { if registryUrl == "" {
registryUrl = env.GetEnvDefault("BlocksMesh_Registry", "http://registry.apinb.com") registryUrl = env.GetEnvDefault("BlocksMesh_Registry", "http://registry.apinb.com")
} }
rootCmd.AddCommand(psCmd, installCmd) rootCmd.AddCommand(psCmd, installCmd, updateCmd, checkCmd)
} }
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{