create-next-rkk 2.0.4 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +19 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -159,7 +159,7 @@ function buildInstallCommand(pm) {
159
159
  program
160
160
  .name('create-next-rkk')
161
161
  .description('Create a new Next.js app with rkk-next pre-configured')
162
- .version('2.0.4')
162
+ .version('2.1.0')
163
163
  .argument('[project-name]', 'name of your project')
164
164
  .action(async (projectName) => {
165
165
  console.log(chalk_1.default.bold.cyan('\nšŸš€ Create RKK Next.js App\n'));
@@ -202,6 +202,24 @@ program
202
202
  }
203
203
  const pm = detectPackageManager();
204
204
  const projectPath = path.join(process.cwd(), targetDir);
205
+ // ── Directory conflict check ─────────────────────────────────────────────
206
+ if (fs.existsSync(projectPath)) {
207
+ const { overwrite } = await inquirer_1.default.prompt([
208
+ {
209
+ type: 'confirm',
210
+ name: 'overwrite',
211
+ message: chalk_1.default.yellow(`Directory "${targetDir}" already exists. Delete it and start fresh?`),
212
+ default: false,
213
+ },
214
+ ]);
215
+ if (!overwrite) {
216
+ console.log(chalk_1.default.red('\nAborted. Choose a different project name or remove the directory.\n'));
217
+ process.exit(0);
218
+ }
219
+ // Remove the existing directory before scaffolding
220
+ fs.rmSync(projectPath, { recursive: true, force: true });
221
+ console.log(chalk_1.default.gray(` Removed existing "${targetDir}" directory.\n`));
222
+ }
205
223
  let createdProject = false;
206
224
  let activeStep = null;
207
225
  const spinner = (0, ora_1.default)('Creating Next.js application...').start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-rkk",
3
- "version": "2.0.4",
3
+ "version": "2.1.1",
4
4
  "description": "CLI tool to create Next.js apps with rkk-next pre-configured",
5
5
  "author": "Rohit Kumar Kundu",
6
6
  "license": "MIT",