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

Function copyTemplateToCurrentDir

cli/cmd/new/newLocal.go:105–118  ·  view source on GitHub ↗

复制templates

(modelType, newProjectType string)

Source from the content-addressed store, hash-verified

103
104// 复制templates
105func copyTemplateToCurrentDir(modelType, newProjectType string) {
106 if newProjectType == "" {
107 newProjectType = "_default"
108 }
109 templatePath := common.PathJoin(config.SmartIdeHome, golbalModel.TMEPLATE_DIR_NAME, modelType, newProjectType)
110 templatesFolderIsExist := common.IsExist(templatePath)
111 if !templatesFolderIsExist {
112 common.SmartIDELog.Error(i18nInstance.New.Info_type_no_exist)
113 }
114 folderPath, err := os.Getwd()
115 common.CheckError(err)
116 copyerr := copyDir(templatePath, folderPath)
117 common.CheckError(copyerr)
118}
119
120// 判断文件夹是坦为空
121// 空为true

Callers 1

LocalNewFunction · 0.85

Calls 3

IsExistMethod · 0.80
copyDirFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected