mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 16:57:26 +00:00
fix reading directories
This commit is contained in:
@@ -189,7 +189,7 @@ async function getInputFiles(paths) {
|
|||||||
for (const path of paths) {
|
for (const path of paths) {
|
||||||
//allow paths ending in / of \ to get all files in that directory
|
//allow paths ending in / of \ to get all files in that directory
|
||||||
const files = path.endsWith('/') || path.endsWith('\\')
|
const files = path.endsWith('/') || path.endsWith('\\')
|
||||||
? await fs.readdir(paths)
|
? (await fsp.readdir(path)).map(file => join(path, file))
|
||||||
: [path];
|
: [path];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user