Feature add template version (#1152)

This commit is contained in:
anqiansong
2021-10-29 09:55:41 +08:00
committed by GitHub
parent bd26783b33
commit 9c48e9ceab
2 changed files with 4 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"github.com/logrusorgru/aurora"
"github.com/tal-tech/go-zero/tools/goctl/internal/version"
)
// NL defines a new line
@@ -88,7 +89,7 @@ func GetTemplateDir(category string) (string, error) {
return "", err
}
return filepath.Join(goctlHome, category), nil
return filepath.Join(goctlHome, version.GetGoctlVersion(), category), nil
}
// InitTemplates creates template files GoctlHome where could get it by GetGoctlHome