Skip to content

Commit 1ec6569

Browse files
jeffmingupjinzhu
andauthored
fix: flag outPath and config error log (#840)
* fix: flag outPath and config error log * Update gentool.go --------- Co-authored-by: Jinzhu <[email protected]>
1 parent fe1f9ea commit 1ec6569

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/gentool/gentool.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ const (
2828
dbSQLServer DBType = "sqlserver"
2929
dbClickHouse DBType = "clickhouse"
3030
)
31-
const (
32-
// DefaultOutPath default path
33-
DefaultOutPath = "./dao/query"
34-
)
3531

3632
// CmdParams is command line parameters
3733
type CmdParams struct {
@@ -133,6 +129,8 @@ func argParse() *CmdParams {
133129
if *genPath != "" {
134130
if configFileParams, err := loadConfigFile(*genPath); err == nil && configFileParams != nil {
135131
cmdParse = *configFileParams
132+
} else if err != nil {
133+
log.Fatalf("loadConfigFile fail %s", err.Error())
136134
}
137135
}
138136
// cmd first
@@ -148,7 +146,7 @@ func argParse() *CmdParams {
148146
if *onlyModel {
149147
cmdParse.OnlyModel = true
150148
}
151-
if *outPath != DefaultOutPath {
149+
if *outPath != "" {
152150
cmdParse.OutPath = *outPath
153151
}
154152
if *outFile != "" {

0 commit comments

Comments
 (0)