Skip to content

Commit c0ec809

Browse files
committed
Run glob in non strict mode
This allows directories without access to be on the given path. E.g. mkdir directory-without-access && sudo chown root:staff directory-without-access && sudo chmod 600 directory-without-access
1 parent e5aa522 commit c0ec809

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

server/src/util/fs.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ export async function getFilePaths({
1717
rootPath: string
1818
}): Promise<string[]> {
1919
return new Promise((resolve, reject) => {
20-
glob(globPattern, { cwd: rootPath, nodir: true, absolute: true }, function(
21-
err,
22-
files,
23-
) {
24-
if (err) {
25-
return reject(err)
26-
}
20+
glob(
21+
globPattern,
22+
{ cwd: rootPath, nodir: true, absolute: true, strict: false },
23+
function(err, files) {
24+
if (err) {
25+
return reject(err)
26+
}
2727

28-
resolve(files)
29-
})
28+
resolve(files)
29+
},
30+
)
3031
})
3132
}

0 commit comments

Comments
 (0)