( projectPath: string, project: ProjectSpecBase, isMultiChainProject = false )
| 176 | } |
| 177 | |
| 178 | export async function prepare( |
| 179 | projectPath: string, |
| 180 | project: ProjectSpecBase, |
| 181 | isMultiChainProject = false |
| 182 | ): Promise<void> { |
| 183 | try { |
| 184 | if (!isMultiChainProject) await prepareEnv(projectPath, project); |
| 185 | } catch (e) { |
| 186 | throw new Error('Failed to prepare read or write .env file while preparing the project'); |
| 187 | } |
| 188 | try { |
| 189 | if (!isMultiChainProject) await prepareManifest(projectPath, project); |
| 190 | } catch (e) { |
| 191 | throw new Error('Failed to prepare read or write manifest while preparing the project'); |
| 192 | } |
| 193 | try { |
| 194 | await preparePackage(projectPath, project); |
| 195 | } catch (e) { |
| 196 | throw new Error('Failed to prepare read or write package.json while preparing the project'); |
| 197 | } |
| 198 | try { |
| 199 | await rimraf(`${projectPath}/.git`); |
| 200 | } catch (e) { |
| 201 | throw new Error('Failed to remove .git from template project'); |
| 202 | } |
| 203 | try { |
| 204 | await prepareGitIgnore(projectPath); |
| 205 | } catch (e) { |
| 206 | throw new Error('Failed to prepare read or write .gitignore while preparing the project'); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | export async function preparePackage(projectPath: string, project: ProjectSpecBase): Promise<void> { |
| 211 | //load and write package.json |
no test coverage detected