@samitouri / QOSami-HFS / commits / 42f8c2b4

fix: hidden files were displayed on Windows #637

Massimo Melina committed Jun 20, 2024 at 18:59 UTC 42f8c2b43d13ca62ba6295c06f0f8ed416e3557a
1 file changed +2 -1
src/util-os.ts
+2 -1
@@ -65,7 +65,8 @@ export async function getDrives() {
65
66 // execute win32 shell commands
67 export async function runCmd(cmd: string, args: string[] = []) {
68 - const { stdout, stderr } = await promisify(exec)(`@chcp 65001 >nul & cmd /c ${cmd} ${args.join(' ')}`, { encoding: 'utf-8' })
68 + const line = `@chcp 65001 >nul & cmd /c ${cmd} ${args.map(x => x.includes(' ') ? `"${x}"` : x).join(' ')}`
69 + const { stdout, stderr } = await promisify(exec)(line, { encoding: 'utf-8' })
70 return (stderr || stdout).replace(/\r/g, '')
71 }
72