cmd: refactoring Run function

So it's easier, more clear, more isolation between code on non-mobile
and mobile platforms.
This commit is contained in:
Cuong Manh Le
2023-09-19 16:29:01 +00:00
committed by Cuong Manh Le
parent 507c1afd59
commit bed7435b0c
4 changed files with 53 additions and 35 deletions

View File

@@ -31,7 +31,6 @@ type AppCallback interface {
func (c *Controller) Start(CdUID string, HomeDir string, logLevel int, logPath string) {
if c.stopCh == nil {
c.stopCh = make(chan struct{})
cli.InitConsoleLogging()
c.Config = cli.AppConfig{
CdUID: CdUID,
HomeDir: HomeDir,
@@ -39,7 +38,7 @@ func (c *Controller) Start(CdUID string, HomeDir string, logLevel int, logPath s
LogPath: logPath,
}
appCallback := mapCallback(c.AppCallback)
cli.Run(nil, &c.Config, &appCallback, c.stopCh)
cli.RunMobile(&c.Config, &appCallback, c.stopCh)
}
}