From 0e8f2b4b676e208c5a3e51f91490e87495710602 Mon Sep 17 00:00:00 2001 From: Kobie Botha Date: Thu, 21 May 2026 14:31:51 -0600 Subject: [PATCH] fix building on windows --- packages/jpgwire/src/certs.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/jpgwire/src/certs.ts b/packages/jpgwire/src/certs.ts index e64cf78d5..956c1a5b6 100644 --- a/packages/jpgwire/src/certs.ts +++ b/packages/jpgwire/src/certs.ts @@ -1,15 +1,16 @@ import * as fs from 'fs/promises'; -import { resolve } from 'path'; +import * as path from 'path'; +import { fileURLToPath } from 'url'; export const DEFAULT_CERTS = await loadDefaultCertificates(); async function loadDefaultCertificates() { - const dir = new URL('../ca', import.meta.url).pathname; + const dir = path.join(path.dirname(fileURLToPath(import.meta.url)), '../ca'); const files = await fs.readdir(dir); let sum = ''; for (let file of files) { if (file.endsWith('.pem')) { - sum += (await fs.readFile(resolve(dir, file), 'utf-8')) + '\n'; + sum += (await fs.readFile(path.resolve(dir, file), 'utf-8')) + '\n'; } } return sum;