anc95 / inquirer-file-tree-selection

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

Have a way to distinguish between empty directories and files #11

Closed NatXenith closed 4 years ago

NatXenith commented 4 years ago

Currently there is no way to distinguish between a file and an empty directory.

Example output (emptydirectory is a directory)

 ? Select a file
 ↓ .(root directory)
   → .git
     emptydirectory
     afile
 -----------------

maybe something like this

 ? Select a file
 ↓ .(root directory)
   → .git\
     emptydirectory\
     afile
 -----------------

I tried using transformer, but since only the path is provided, I would have to make a file system call to check if the path is a directory.

anc95 commented 4 years ago

thx, i just published a new version 1.0.5 which default add a slash(on poxis is '/', on window is '\'), after directory.

you can install the new version

npm i inquirer-file-tree-selection-prompt@1.0.5

to see the change