fix: frontend couldn't list files in drive's root on Windows

Massimo Melina committed Feb 10, 2022 at 19:50 UTC 9a6b6e274d12ed9532bee5588cc3aafdeed0df84
1 file changed +2 -2
src/vfs.ts
+2 -2
@@ -122,15 +122,15 @@ export async function* walkNode(parent:VfsNode, ctx: Koa.Context, depth:number=0
122 return
123 const depthPath = depth === Infinity ? '**/' : _.repeat('*/',depth)
124 try {
125 + const base = enforceFinal('/', source)
126 const dirStream = glob.stream(depthPath + '*', {
127 dot: true,
128 onlyFiles: false,
128 - cwd: source,
129 + cwd: base,
130 suppressErrors: true,
131 caseSensitiveMatch: !isWindows(),
132 ignore: onlyTruthy([parent.hide, parent.remove]),
133 })
133 - const base = enforceFinal('/', source)
134 for await (let path of dirStream) {
135 if (ctx.req.aborted)
136 return