fix logout
整理代码输出
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/xxjwxc/public/tools"
|
||||
"github.com/xxjwxc/public/mylog"
|
||||
|
||||
"github.com/xxjwxc/gormt/data/view/gtools"
|
||||
"github.com/xxjwxc/public/tools"
|
||||
|
||||
"github.com/xxjwxc/gormt/data/config"
|
||||
|
||||
@@ -85,12 +85,12 @@ func initConfig() {
|
||||
validate := validator.New()
|
||||
err := validate.Struct(config.GetMysqlDbInfo())
|
||||
if err != nil {
|
||||
fmt.Println("Can't read cmd: using (-h, --help) to get more imfo")
|
||||
fmt.Println("error info: ", err, err)
|
||||
mylog.Info("Can't read cmd: using (-h, --help) to get more imfo")
|
||||
mylog.Error(err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
fmt.Println("using config info:")
|
||||
fmt.Println(tools.GetJSONStr(config.GetMysqlDbInfo(), true))
|
||||
mylog.Info("using database info:")
|
||||
mylog.Info(tools.GetJSONStr(config.GetMysqlDbInfo(), true))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ var _map = Config{
|
||||
var configPath string
|
||||
|
||||
func init() {
|
||||
configPath = path.Join(tools.GetModelPath(), "config.yml")
|
||||
configPath = path.Join(tools.GetCurrentDirectory(), "config.yml")
|
||||
onInit()
|
||||
dev.OnSetDev(_map.IsDev)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package gtools
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"github.com/xxjwxc/public/mylog"
|
||||
|
||||
"github.com/xxjwxc/gormt/data/dlg"
|
||||
"github.com/xxjwxc/gormt/data/view/model"
|
||||
|
||||
@@ -39,12 +40,12 @@ func showCmd() {
|
||||
path := config.GetOutDir() + "/" + v.FileName
|
||||
tools.WriteFile(path, []string{v.FileCtx}, true)
|
||||
|
||||
fmt.Println("formatting differs from goimport's:")
|
||||
mylog.Info("formatting differs from goimport's:")
|
||||
cmd, _ := exec.Command("goimports", "-l", "-w", path).Output()
|
||||
fmt.Println(string(cmd))
|
||||
mylog.Info(string(cmd))
|
||||
|
||||
fmt.Println("formatting differs from gofmt's:")
|
||||
mylog.Info("formatting differs from gofmt's:")
|
||||
cmd, _ = exec.Command("gofmt", "-l", "-w", path).Output()
|
||||
fmt.Println(string(cmd))
|
||||
mylog.Info(string(cmd))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user