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

Function CopyTemplateToCurrentDir

cli/cmd/init/local.go:62–75  ·  view source on GitHub ↗

复制templates

(modelType, newProjectType string)

Source from the content-addressed store, hash-verified

60
61// 复制templates
62func CopyTemplateToCurrentDir(modelType, newProjectType string) {
63 if newProjectType == "" {
64 newProjectType = "_default"
65 }
66 templatePath := common.PathJoin(config.SmartIdeHome, TMEPLATE_DIR_NAME, modelType, newProjectType)
67 templatesFolderIsExist := common.IsExist(templatePath)
68 if !templatesFolderIsExist {
69 common.SmartIDELog.Error(i18nInstance.New.Info_type_no_exist)
70 }
71 folderPath, err := os.Getwd()
72 common.CheckError(err)
73 copyerr := copyDir(templatePath, folderPath)
74 common.CheckError(copyerr)
75}
76
77/**
78 * 拷贝文件夹,同时拷贝文件夹中的文件

Callers 1

InitLocalConfigFunction · 0.85

Calls 3

IsExistMethod · 0.80
copyDirFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected