-
Notifications
You must be signed in to change notification settings - Fork 0
/
AskIgnore.js
35 lines (33 loc) · 948 Bytes
/
AskIgnore.js
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
35
import inquirer from "inquirer";
import chalk from "chalk";
import inquirerFileTreeSelection from "inquirer-file-tree-selection-prompt";
import { argv } from "./bin.js";
export const AskIgnore = (Files) => {
const path = argv.path || process.cwd();
inquirer.registerPrompt("file-tree-selection", inquirerFileTreeSelection);
inquirer
.prompt([
{
root: "..",
type: "file-tree-selection",
name: "file",
// multiple: true,
},
])
.then((answers) => {
console.log(JSON.stringify(answers));
console.log(answers);
Files.push(answers.file);
console.log(Files);
inquirer.prompt([
{
type: "confirm",
name: "another ",
message: "Do you want to add another file/folder to be ignored?",
default: false,
prefix: " 🌎 ",
transformer: (s) => chalk.bold.greenBright(s),
},
]);
});
};