(ctx: Context)
| 255 | } |
| 256 | |
| 257 | async function copyTemplateToTempDirStep(ctx: Context) { |
| 258 | if (ctx.template) { |
| 259 | log(""); |
| 260 | info("Template:", ["Using ", color.reset(ctx.template), "..."]); |
| 261 | } else { |
| 262 | log(""); |
| 263 | info("Using default template", [ |
| 264 | "See https://github.com/remix-run/react-router-templates for more", |
| 265 | ]); |
| 266 | } |
| 267 | |
| 268 | let template = |
| 269 | ctx.template ?? |
| 270 | "https://github.com/remix-run/react-router-templates/tree/main/default"; |
| 271 | |
| 272 | await loadingIndicator({ |
| 273 | start: "Template copying...", |
| 274 | end: "Template copied", |
| 275 | while: async () => { |
| 276 | await ensureDirectory(ctx.tempDir); |
| 277 | if (ctx.debug) { |
| 278 | debug(`Extracting to: ${ctx.tempDir}`); |
| 279 | } |
| 280 | |
| 281 | let result = await copyTemplate(template, ctx.tempDir, { |
| 282 | debug: ctx.debug, |
| 283 | token: ctx.token, |
| 284 | async onError(err) { |
| 285 | error( |
| 286 | "Oh no!", |
| 287 | err instanceof CopyTemplateError |
| 288 | ? err.message |
| 289 | : "Something went wrong. Run `create-react-router --debug` to see more info.\n\n" + |
| 290 | "Open an issue to report the problem at " + |
| 291 | "https://github.com/remix-run/react-router/issues/new", |
| 292 | ); |
| 293 | throw err; |
| 294 | }, |
| 295 | async log(message) { |
| 296 | if (ctx.debug) { |
| 297 | debug(message); |
| 298 | await sleep(500); |
| 299 | } |
| 300 | }, |
| 301 | }); |
| 302 | |
| 303 | if (result?.localTemplateDirectory) { |
| 304 | ctx.tempDir = path.resolve(result.localTemplateDirectory); |
| 305 | } |
| 306 | }, |
| 307 | ctx, |
| 308 | }); |
| 309 | } |
| 310 | |
| 311 | async function agentSkillsQuestionStep(ctx: Context) { |
| 312 | if (ctx.agentSkills === undefined) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…