@gravirei/reis 1.0.7 → 1.0.8
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/reis.js +19 -14
- package/package.json +1 -1
package/bin/reis.js
CHANGED
|
@@ -242,37 +242,42 @@ program.action(async () => {
|
|
|
242
242
|
|
|
243
243
|
if (isInstalled) {
|
|
244
244
|
console.log(chalk.yellow(' ⚠️ REIS is already installed at ~/.rovodev/reis/\n'));
|
|
245
|
+
console.log(chalk.white(' What would you like to do?\n'));
|
|
246
|
+
console.log(chalk.white(' 1) Keep existing installation'));
|
|
247
|
+
console.log(chalk.white(' 2) Reinstall (replace existing files)\n'));
|
|
245
248
|
|
|
246
|
-
// Use inquirer for
|
|
249
|
+
// Use inquirer for simple input prompt
|
|
247
250
|
const inquirer = require('inquirer');
|
|
248
251
|
try {
|
|
249
252
|
const { choice } = await inquirer.prompt([
|
|
250
253
|
{
|
|
251
|
-
type: '
|
|
254
|
+
type: 'input',
|
|
252
255
|
name: 'choice',
|
|
253
|
-
message: '
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
message: 'Choice [1]:',
|
|
257
|
+
default: '1',
|
|
258
|
+
validate: (input) => {
|
|
259
|
+
if (input === '1' || input === '2') {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
return 'Please enter 1 or 2';
|
|
263
|
+
}
|
|
259
264
|
}
|
|
260
265
|
]);
|
|
261
266
|
|
|
262
267
|
console.log('');
|
|
263
268
|
|
|
264
|
-
if (choice === '
|
|
269
|
+
if (choice === '2') {
|
|
265
270
|
console.log(chalk.cyan(' Reinstalling REIS files...\n'));
|
|
266
271
|
const install = require('../lib/install.js');
|
|
267
272
|
// The install module runs automatically
|
|
268
|
-
} else if (choice === 'help') {
|
|
269
|
-
const helpCmd = require('../lib/commands/help');
|
|
270
|
-
helpCmd();
|
|
271
273
|
} else {
|
|
272
274
|
console.log(chalk.green(' ✓ Keeping existing installation\n'));
|
|
273
|
-
const helpCmd = require('../lib/commands/help');
|
|
274
|
-
helpCmd();
|
|
275
275
|
}
|
|
276
|
+
|
|
277
|
+
// Always show help after
|
|
278
|
+
const helpCmd = require('../lib/commands/help');
|
|
279
|
+
helpCmd();
|
|
280
|
+
|
|
276
281
|
} catch (err) {
|
|
277
282
|
// If inquirer fails (non-interactive), just show help
|
|
278
283
|
console.log(chalk.gray(' Non-interactive mode - showing help...\n'));
|
package/package.json
CHANGED