MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / loadTemplatesJson

Function loadTemplatesJson

cli/cmd/common/template.go:119–129  ·  view source on GitHub ↗

加载templates索引json

()

Source from the content-addressed store, hash-verified

117
118// 加载templates索引json
119func 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
132func templatesClone() error {

Callers 1

GetTemplateSettingFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected