check if path is directory using lstat instead of requiring trailing slash

This commit is contained in:
DetachHead
2020-12-27 15:59:56 +10:00
parent 1e64e52298
commit 10d648c28d

View File

@@ -188,7 +188,7 @@ async function getInputFiles(paths) {
for (const path of paths) {
//allow paths ending in / of \ to get all files in that directory
const files = path.endsWith('/') || path.endsWith('\\')
const files = (await fsp.lstat(path)).isDirectory()
? (await fsp.readdir(path)).map(file => join(path, file))
: [path];
for (const file of files) {