Small corrections
63f447d4
2 file(s) · +7 −7
| 24 | 24 | } |
|
| 25 | 25 | ||
| 26 | 26 | const gitInitialized = await initializeGit( |
|
| 27 | - | projectOptions.projectName, |
|
| 27 | + | projectOptions.projectName ?? projectDirectory, |
|
| 28 | 28 | projectOptions.yes, |
|
| 29 | 29 | ); |
|
| 30 | 30 | const dependenciesInstalled = await installDependencies( |
|
| 31 | - | projectOptions.projectName, |
|
| 31 | + | projectOptions.projectName ?? projectDirectory, |
|
| 32 | 32 | projectOptions.yes, |
|
| 33 | 33 | ); |
|
| 34 | 34 | ||
| 35 | 35 | return { |
|
| 36 | - | projectName: projectOptions.projectName, |
|
| 36 | + | projectName: projectOptions.projectName ?? projectDirectory, |
|
| 37 | 37 | gitInitialized, |
|
| 38 | 38 | dependenciesInstalled, |
|
| 39 | - | template: projectOptions.template, |
|
| 39 | + | template: projectOptions.template ?? "default", |
|
| 40 | 40 | }; |
|
| 41 | 41 | } |
| 8 | 8 | try { |
|
| 9 | 9 | await execa("bun", ["--version"]); |
|
| 10 | 10 | return "bun"; |
|
| 11 | - | } catch (e) { |
|
| 11 | + | } catch (_e) { |
|
| 12 | 12 | // bun is not installed |
|
| 13 | 13 | } |
|
| 14 | 14 | ||
| 15 | 15 | try { |
|
| 16 | 16 | await execa("pnpm", ["--version"]); |
|
| 17 | 17 | return "pnpm"; |
|
| 18 | - | } catch (e) { |
|
| 18 | + | } catch (_e) { |
|
| 19 | 19 | // pnpm is not installed |
|
| 20 | 20 | } |
|
| 21 | 21 | ||
| 54 | 54 | await execa(packageManager, ["install"], { cwd: projectPath }); |
|
| 55 | 55 | spinner.succeed(`Dependencies installed with ${packageManager}`); |
|
| 56 | 56 | return true; |
|
| 57 | - | } catch (err) { |
|
| 57 | + | } catch (_err) { |
|
| 58 | 58 | spinner.fail("Failed to install dependencies."); |
|
| 59 | 59 | console.log( |
|
| 60 | 60 | pc.yellow( |
|