( localPath: string, projectName: string, projectRemote: string, branch: string )
| 99 | } |
| 100 | |
| 101 | export async function cloneProjectGit( |
| 102 | localPath: string, |
| 103 | projectName: string, |
| 104 | projectRemote: string, |
| 105 | branch: string |
| 106 | ): Promise<string> { |
| 107 | const projectPath = path.join(localPath, projectName); |
| 108 | try { |
| 109 | await git().clone(projectRemote, projectPath, ['-b', branch, '--single-branch']); |
| 110 | } catch (e) { |
| 111 | let err = 'Failed to clone starter template from git'; |
| 112 | try { |
| 113 | execSync('git --version'); |
| 114 | } catch (_) { |
| 115 | err += ', please install git and ensure that it is available from command line'; |
| 116 | } |
| 117 | throw new Error(err); |
| 118 | } |
| 119 | return projectPath; |
| 120 | } |
| 121 | |
| 122 | export async function cloneProjectTemplate( |
| 123 | localPath: string, |
no test coverage detected