-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestInquirer.js
More file actions
34 lines (32 loc) · 874 Bytes
/
testInquirer.js
File metadata and controls
34 lines (32 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const inquirer = require('inquirer');
const chalk = require('chalk');
function testInquirer() {
inquirer
.prompt([
{
type: 'list',
name: 'openIn',
message: 'Where would you like to open the project?',
choices: ['Terminal', 'VSCode', 'Neovim', 'None'],
},
])
.then((answers) => {
switch (answers.openIn) {
case 'Terminal':
console.log(chalk.green('Opening in Terminal...'));
break;
case 'VSCode':
console.log(chalk.blue('Opening in VSCode...'));
break;
case 'Neovim':
console.log(chalk.magenta('Opening in Neovim...'));
break;
default:
console.log(chalk.yellow('No action taken.'));
}
})
.catch((error) => {
console.log(chalk.red('An error occurred:'), error);
});
}
testInquirer();