fix logout

整理代码输出
This commit is contained in:
xxjwxc
2020-05-01 12:22:21 +08:00
parent 20393072c0
commit fafe362f40
6 changed files with 19 additions and 18 deletions

View File

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

View File

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

View File

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