anc95 / inquirer-file-tree-selection

inquirer prompt for select a file or dir by file tree
49 stars 26 forks source link

Changing root path causes inquirer to hang. #18

Closed andrew-bibby closed 3 years ago

andrew-bibby commented 3 years ago

I want to be able to select files from outside the current working directory (process.cwd()). However if I update the root parameter to anything higher than the current directory it hangs. Is this something that is not possible with this library or an error in my configuration?

{
     type: 'file-tree-selection',
     name: 'example',
     root: "/",
     message: "Choose file:",
}
tylertownsend commented 3 years ago

I was able to produce the same issue setting root: '/'. However, by setting root: '../' I was able to select from the parent directory of my project.

anc95 commented 3 years ago

I have tested the case on my pc, the terminal hangs is caused by there are two many files under the root (/) directory, it takes time to traverse.

I will work on the optimization of implementation right now

anc95 commented 3 years ago

@andrew-bibby I just publish a new version 1.0.7 which fixed this issue