Skip to content

Commit

Permalink
fix: hidden files on Windows were displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
rejetto committed Dec 19, 2023
1 parent 9ca6d00 commit d5f3dc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export async function* dirStream(path: string, { depth=0, onlyFiles=false, onlyF
async function getItemsToSkip(path: string) {
if (!IS_WINDOWS) return
const winPath = path.replace(/\//g, '\\')
const out = await runCmd('dir', ['/ah', '/b', depth ? '/s' : '', winPath])
const out = await runCmd('dir', ['/ah', '/b', depth ? '/s' : '/c', winPath]) // cannot pass '', so we pass /c as a noop parameter
.catch(()=>'') // error in case of no matching file
return out.split('\r\n').slice(0,-1).map(x =>
!depth ? x : x.slice(winPath.length + 1).replace(/\\/g, '/'))
Expand Down

0 comments on commit d5f3dc6

Please sign in to comment.