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

Function InitLocalConfig

cli/cmd/init/local.go:36–59  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

34)
35
36func InitLocalConfig(cmd *cobra.Command, args []string) {
37
38 appinsight.SetCliTrack(appinsight.Cli_Local_Init, args)
39
40 // 检测当前文件夹是否有.ide.yaml,有了返回
41 hasIdeConfigYaml := common.IsExist(".ide/.ide.yaml")
42 if hasIdeConfigYaml {
43 common.SmartIDELog.Info(i18nInstance.Init.Info_exist_template)
44 return
45 }
46
47 if !hasIdeConfigYaml {
48 //获取command中的配置
49 selectedTemplateType, err := getTemplateSetting(cmd, args)
50 common.CheckError(err)
51 if selectedTemplateType == nil { // 未指定模板类型的时候,提示用户后退出
52 return // 退出
53 }
54 // 复制template 下到当前文件夹
55 CopyTemplateToCurrentDir(selectedTemplateType.TypeName, selectedTemplateType.SubType)
56 }
57
58 common.SmartIDELog.Info(i18nInstance.Init.Info_Init_Complete)
59}
60
61// 复制templates
62func CopyTemplateToCurrentDir(modelType, newProjectType string) {

Callers

nothing calls this directly

Calls 4

getTemplateSettingFunction · 0.85
CopyTemplateToCurrentDirFunction · 0.85
IsExistMethod · 0.80
InfoMethod · 0.80

Tested by

no test coverage detected