fix: hidden files on Windows were displayed
Massimo Melina committed
Dec 17, 2023 at 22:28 UTC
1968e2b1fa7b5195a02fb1fe60d8dac1c5e59b05
1 file changed
+1
-1
src/util-files.ts
+1
-1
@@ -98,7 +98,7 @@ export async function* dirStream(path: string, deep=0) {
98
async function getItemsToSkip(path: string) {
99
if (!IS_WINDOWS) return
100
const winPath = path.replace(/\//g, '\\')
101
- const out = await runCmd('dir', ['/ah', '/b', deep ? '/s' : '', winPath])
101
+ const out = await runCmd('dir', ['/ah', '/b', deep ? '/s' : '/c', winPath]) // cannot pass '', so we pass /c as a noop parameter
102
.catch(()=>'') // error in case of no matching file
103
return out.split('\r\n').slice(0,-1).map(x =>
104
!deep ? x : x.slice(winPath.length + 1).replace(/\\/g, '/'))