From b788606bc2f7a314b6c3b533fb7f3218a082dd85 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 4 Oct 2026 19:46:46 +0800 Subject: [PATCH] fix: create certificate cache directories recursively --- src/util.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/util.ts b/src/util.ts index e294f01..756697d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -11,12 +11,7 @@ type HttpsConfig = ServerConfig['https']; const __dirname = path.dirname(fileURLToPath(import.meta.url)); async function ensureDir(dir: string) { - try { - await fs.promises.access(dir); - } catch { - await ensureDir(path.dirname(dir)); - await fs.promises.mkdir(dir); - } + await fs.promises.mkdir(dir, { recursive: true }); } function isCertValid(content: string) {