加载templates索引json
()
| 117 | |
| 118 | // 加载templates索引json |
| 119 | func loadTemplatesJson() (templateTypes []templateModel.TemplateTypeInfo, err error) { |
| 120 | // new type转换为结构体 |
| 121 | templatesPath := common.PathJoin(config.SmartIdeHome, golbalModel.TMEPLATE_DIR_NAME, "templates.json") |
| 122 | templatesByte, err := os.ReadFile(templatesPath) |
| 123 | if err != nil { |
| 124 | return templateTypes, errors.New(i18nInstance.New.Err_read_templates + templatesPath + err.Error()) |
| 125 | } |
| 126 | |
| 127 | err = json.Unmarshal(templatesByte, &templateTypes) |
| 128 | return templateTypes, err |
| 129 | } |
| 130 | |
| 131 | // clone模版repo |
| 132 | func templatesClone() error { |
no test coverage detected