fix: project render

This commit is contained in:
Rogee
2024-12-23 11:24:20 +08:00
parent f6a02b5ac8
commit 0c9bf76971
2 changed files with 7 additions and 0 deletions

View File

@@ -117,6 +117,13 @@ func commandNewProjectE(cmd *cobra.Command, args []string) error {
return tmpl.Execute(f, projectInfo)
}
// 处理模板文件
if strings.HasSuffix(path, ".raw") {
// 创建目标文件(去除.tpl后缀
targetPath = strings.TrimSuffix(targetPath, ".raw")
log.Infof("创建文件: %s", targetPath)
}
// 复制非模板文件
return os.WriteFile(targetPath, content, 0o644)
}); err != nil {