Set runtime mode and display it in start command
This commit is contained in:
parent
90e05c5be2
commit
c07b903c5c
2 changed files with 12 additions and 3 deletions
|
|
@ -41,6 +41,9 @@ var runCmd = &cobra.Command{
|
|||
|
||||
Boot()
|
||||
|
||||
// Set Runtime Mode
|
||||
config.Conf.Runtime.Mode = "standard"
|
||||
|
||||
cfg := config.Conf
|
||||
cfg.Session.IsCLI = true
|
||||
if len(args) < 1 {
|
||||
|
|
|
|||
12
cmd/start.go
12
cmd/start.go
|
|
@ -89,10 +89,15 @@ var startCmd = &cobra.Command{
|
|||
mode := config.Conf.Mode
|
||||
host := config.Conf.Host
|
||||
dataRoot := fs.Root()
|
||||
runtimeMode := config.Conf.Runtime.Mode
|
||||
|
||||
fmt.Println(color.WhiteString("\n---------------------------------"))
|
||||
fmt.Println(color.WhiteString(strings.TrimPrefix(share.App.Name, "::")), color.WhiteString(share.App.Version), mode)
|
||||
fmt.Println(color.WhiteString("---------------------------------"))
|
||||
fmt.Println(color.WhiteString("\n--------------------------------------------"))
|
||||
fmt.Println(
|
||||
color.WhiteString(strings.TrimPrefix(share.App.Name, "::")),
|
||||
color.WhiteString(share.App.Version),
|
||||
mode,
|
||||
)
|
||||
fmt.Println(color.WhiteString("--------------------------------------------"))
|
||||
if !share.BUILDIN {
|
||||
root, _ := filepath.Abs(config.Conf.Root)
|
||||
fmt.Println(color.WhiteString(L("Root")), color.GreenString(" %s", root))
|
||||
|
|
@ -104,6 +109,7 @@ var startCmd = &cobra.Command{
|
|||
urls, _ = setup.URLs(config.Conf)
|
||||
}
|
||||
|
||||
fmt.Println(color.WhiteString(L("Runtime")), color.GreenString(" %s", runtimeMode))
|
||||
fmt.Println(color.WhiteString(L("Data")), color.GreenString(" %s", dataRoot))
|
||||
fmt.Println(color.WhiteString(L("Listening")), color.GreenString(" %s:%d", config.Conf.Host, config.Conf.Port))
|
||||
for _, url := range urls {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue