整理打印
This commit is contained in:
+19
-2
@@ -4,6 +4,8 @@ import (
|
||||
"complie-erlang/config"
|
||||
tm "complie-erlang/template"
|
||||
"complie-erlang/worker"
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
"gopkg.in/yaml.v2"
|
||||
"log"
|
||||
"os"
|
||||
@@ -62,7 +64,7 @@ func ExecuteSingleDir(args []string) {
|
||||
}
|
||||
|
||||
for _, filename := range erlFiles {
|
||||
log.Printf("[info] 检索到文件: %v %s\n", cfgPublic.Filename, filename)
|
||||
fmt.Printf("[info] 检索到文件: %v %s:1\n", cfgPublic.Filename, filename)
|
||||
// 根据配置解析出 文件数据
|
||||
parseTemKey, err := worker1.ParseTemKey(filename, cfgPublic)
|
||||
if err != nil {
|
||||
@@ -89,8 +91,23 @@ func ExecuteSingleDir(args []string) {
|
||||
log.Printf("[warn] 生成文件失败: %v %s", err, outFileNema)
|
||||
continue
|
||||
}
|
||||
log.Printf("[info] 生成文件: %s\n", outFileNema)
|
||||
fmt.Printf("[info] 生成文件: %s:1\n\n", outFileNema)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func init() {
|
||||
var logsCmd = &cobra.Command{
|
||||
Use: "cfg",
|
||||
Short: "配置生成",
|
||||
Long: `根据 标注 构建 功能配置模版`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
args = []string{"config.yaml"}
|
||||
}
|
||||
ExecuteSingleDir(args)
|
||||
},
|
||||
}
|
||||
rootCmd.AddCommand(logsCmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user