diff --git a/src/create.ts b/src/create.ts index f32ca8c..30dc128 100644 --- a/src/create.ts +++ b/src/create.ts @@ -110,8 +110,8 @@ export async function createArchiveByFileStat( path: string, options: Readonly | null = null ) { - const st = await stat(path); - return st.isDirectory() + const st = await stat(path).catch(() => null); + return st?.isDirectory() ? new ArchiveDir(path) : createArchiveByFileExtension(path, options); }