(cmd *cobra.Command, args []string)
| 34 | ) |
| 35 | |
| 36 | func 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 |
| 62 | func CopyTemplateToCurrentDir(modelType, newProjectType string) { |
nothing calls this directly
no test coverage detected