refactor file|path (#1409)

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2022-01-03 21:32:40 +08:00
committed by GitHub
parent 290de6aa96
commit 89ce5e492b
81 changed files with 279 additions and 245 deletions

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/tal-tech/go-zero/tools/goctl/model/mongo/template"
"github.com/tal-tech/go-zero/tools/goctl/util"
"github.com/tal-tech/go-zero/tools/goctl/util/pathx"
"github.com/urfave/cli"
)
@@ -26,12 +26,12 @@ func Category() string {
// Clean cleans the mongo templates.
func Clean() error {
return util.Clean(category)
return pathx.Clean(category)
}
// Templates initializes the mongo templates.
func Templates(_ *cli.Context) error {
return util.InitTemplates(category, templates)
return pathx.InitTemplates(category, templates)
}
// RevertTemplate reverts the given template.
@@ -41,7 +41,7 @@ func RevertTemplate(name string) error {
return fmt.Errorf("%s: no such file name", name)
}
return util.CreateTemplate(category, name, content)
return pathx.CreateTemplate(category, name, content)
}
// Update cleans and updates the templates.
@@ -51,5 +51,5 @@ func Update() error {
return err
}
return util.InitTemplates(category, templates)
return pathx.InitTemplates(category, templates)
}