(spawner: typeof execa)
| 128 | }; |
| 129 | |
| 130 | export const install = (spawner: typeof execa) => async ( |
| 131 | runner: Runner, |
| 132 | projectDir: string |
| 133 | ) => { |
| 134 | const opts: Options = { |
| 135 | cwd: projectDir, |
| 136 | encoding: 'utf8', |
| 137 | stdio: 'inherit', |
| 138 | }; |
| 139 | try { |
| 140 | runner === Runner.Npm |
| 141 | ? spawner('npm', ['install'], opts) |
| 142 | : spawner('yarn', opts); |
| 143 | } catch (err) { |
| 144 | // eslint-disable-next-line functional/no-throw-statement |
| 145 | throw new Error(`Installation failed. You'll need to install manually.`); |
| 146 | } |
| 147 | }; |
| 148 | |
| 149 | /** |
| 150 | * Returns the URL and branch to clone. We clone the branch (tag) at the current |
no outgoing calls
no test coverage detected