复制templates
(modelType, newProjectType string)
| 103 | |
| 104 | // 复制templates |
| 105 | func 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 |