1 | const inquirer = require("inquirer");
|
2 | inquirer.registerPrompt("fuzzypath", require("inquirer-fuzzy-path"));
|
3 |
|
4 | (async () => {
|
5 | return inquirer.prompt([
|
6 | {
|
7 | type: "fuzzypath",
|
8 | name: "path",
|
9 | excludePath: nodePath =>
|
10 | nodePath.startsWith("node_modules") ||
|
11 | nodePath.startsWith(".git") ||
|
12 | nodePath.startsWith(".idea"),
|
13 | // excludePath :: (String) -> Bool
|
14 | // excludePath to exclude some paths from the file-system scan
|
15 | // itemType: "any",
|
16 | itemType: "directory" | "file", //'any' | | 'file'
|
17 | // specify the type of nodes to display
|
18 | // default value: 'any'
|
19 | // example: itemType: 'file' - hides directories from the item list
|
20 | // rootPath: "app",
|
21 | // rootPath :: String
|
22 | // Root search directory
|
23 | message: "Select a target directory for your component:",
|
24 | // default: "./",
|
25 | suggestOnly: false
|
26 | // suggestOnly :: Bool
|
27 | // Restrict prompt answer to available choices or use them as suggestions
|
28 | }
|
29 | ]);
|
30 | })();
|