vending-mocha 0.1.3 → 0.1.4
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/bin/cli.js +0 -40
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -220,35 +220,11 @@ async function handleNew(projectName, options) {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
questions.push({
|
|
224
|
-
type: 'input',
|
|
225
|
-
name: 'title',
|
|
226
|
-
message: 'What is the title of your blog?',
|
|
227
|
-
default: (answers) => answers.projectName || projectName
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
questions.push({
|
|
231
|
-
type: 'input',
|
|
232
|
-
name: 'url',
|
|
233
|
-
message: 'What is the production URL of your blog?',
|
|
234
|
-
default: (answers) => `https://example.com/${answers.projectName || projectName}`
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
questions.push({
|
|
238
|
-
type: 'input',
|
|
239
|
-
name: 'description',
|
|
240
|
-
message: 'Write a short description for your blog:',
|
|
241
|
-
default: 'A personal blogging framework for developers.'
|
|
242
|
-
});
|
|
243
|
-
|
|
244
223
|
const answers = await inquirer.prompt(questions);
|
|
245
224
|
|
|
246
225
|
// Merge args and answers
|
|
247
226
|
const config = {
|
|
248
227
|
projectName: projectName || answers.projectName,
|
|
249
|
-
title: answers.title,
|
|
250
|
-
url: answers.url,
|
|
251
|
-
description: answers.description
|
|
252
228
|
};
|
|
253
229
|
|
|
254
230
|
const currentDir = process.cwd();
|
|
@@ -271,25 +247,9 @@ async function handleNew(projectName, options) {
|
|
|
271
247
|
|
|
272
248
|
// 2. Update config
|
|
273
249
|
console.log(chalk.gray('Updating configuration...'));
|
|
274
|
-
updateSiteConfig(projectDir, config);
|
|
275
|
-
console.log(chalk.green('✔ Configuration updated'));
|
|
276
|
-
|
|
277
|
-
// 3. Update package.json
|
|
278
|
-
console.log(chalk.gray('Updating package.json...'));
|
|
279
250
|
updatePackageJson(projectDir, config);
|
|
280
251
|
console.log(chalk.green('✔ package.json updated'));
|
|
281
252
|
|
|
282
|
-
// 4. Initialize Git
|
|
283
|
-
console.log(chalk.gray('Initializing git repository...'));
|
|
284
|
-
try {
|
|
285
|
-
execSync('git init', { cwd: projectDir, stdio: 'ignore' });
|
|
286
|
-
execSync('git add .', { cwd: projectDir, stdio: 'ignore' });
|
|
287
|
-
execSync('git commit -m "Initial commit from vending-mocha"', { cwd: projectDir, stdio: 'ignore' });
|
|
288
|
-
console.log(chalk.green('✔ Git initialized'));
|
|
289
|
-
} catch (e) {
|
|
290
|
-
console.warn(chalk.yellow('⚠ Failed to initialize git repository (git might not be installed).'));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
253
|
console.log(chalk.green(`\nSuccess! Created ${config.projectName} at ${projectDir}`));
|
|
294
254
|
console.log('\nInside that directory, you can run:');
|
|
295
255
|
console.log(chalk.cyan(` cd ${config.projectName}`));
|