提交 60caf59a 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix a issue when provide yaml with -d

上级 6edef981
......@@ -7,7 +7,7 @@ field: number
prefix: "'"
postfix: "'"
loop: 2
loopfix: "-"
loopfix: "."
ranges:
small: 1-9
medium: 11-99
......
......@@ -18,14 +18,15 @@ import (
func Generate(deflt string, yml string, total int, fieldsToExportStr string, out string, format string, table string) {
startTime := time.Now().Unix()
vari.InputDir = filepath.Dir(yml) + string(os.PathSeparator)
constant.Total = total
if deflt != "" && yml == "" {
yml = deflt
deflt = ""
}
vari.InputDir = filepath.Dir(yml) + string(os.PathSeparator)
constant.Total = total
fieldsToExport := strings.Split(fieldsToExportStr, ",")
rows, colTypes := gen.GenerateForDefinition(deflt, yml, fieldsToExport, total)
content := Print(rows, format, table, colTypes, fieldsToExport)
......
......@@ -183,7 +183,7 @@ func LoopSubFields(field *model.DefField, oldValues []string, total int) []strin
count := 0
for {
// 处理格式、前后缀、loop等
str := GenerateFieldValWithFix(*field, fieldValue, &index, false)
str := GenerateFieldValWithFix(*field, fieldValue, &index, true)
values = append(values, str)
count++
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册