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.
- package/dist/index.js +19 -1
- 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
|
|
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();
|