1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

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

This commit is contained in:
zhengkunwang223 2023-04-25 21:28:17 +08:00 committed by GitHub
parent 37806f1113
commit 05e7506f61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
},
}