feat: 1pctl version 增加 mode 参数 (#784)

pull/790/head
zhengkunwang223 2 years ago committed by GitHub
parent 37806f1113
commit 05e7506f61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,9 @@ package cmd
import (
"fmt"
"github.com/1Panel-dev/1Panel/backend/configs"
"github.com/1Panel-dev/1Panel/cmd/server/conf"
"gopkg.in/yaml.v3"
"strings"
cmdUtils "github.com/1Panel-dev/1Panel/backend/utils/cmd"
@ -39,6 +42,11 @@ var versionCmd = &cobra.Command{
fmt.Printf("1panel version: %s\n", version)
fmt.Printf("appstore version: %s\n", appStoreVersion)
config := configs.ServerConfig{}
if err := yaml.Unmarshal(conf.AppYaml, &config); err != nil {
panic(err)
}
fmt.Printf("mode: %s\n", config.System.Mode)
return nil
},
}

Loading…
Cancel
Save