* Initializes the example app from `expo-template-blank-typescript` at the given dist-tag.
( packageManager: PackageManagerName, exampleProjectSlug: string, targetDir: string, distTag: string )
| 114 | * Initializes the example app from `expo-template-blank-typescript` at the given dist-tag. |
| 115 | */ |
| 116 | async function initExampleApp( |
| 117 | packageManager: PackageManagerName, |
| 118 | exampleProjectSlug: string, |
| 119 | targetDir: string, |
| 120 | distTag: string |
| 121 | ): Promise<void> { |
| 122 | const template = `expo-template-blank-typescript@${distTag}`; |
| 123 | debug(`Using example template: ${template}`); |
| 124 | const command = createCommand(packageManager, exampleProjectSlug, template); |
| 125 | |
| 126 | try { |
| 127 | await spawnAsync(packageManager, command, { |
| 128 | cwd: targetDir, |
| 129 | }); |
| 130 | } catch (error: any) { |
| 131 | throw new Error( |
| 132 | `${command.join(' ')} failed with exit code: ${error?.status}.\n\nError stack:\n${error?.stderr}` |
| 133 | ); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | function createCommand( |
| 138 | packageManager: PackageManagerName, |
no test coverage detected
searching dependent graphs…