From 117c4db22b00d4b9d3da4705c997538444d8b1f3 Mon Sep 17 00:00:00 2001 From: wolfy1339 <4595477+wolfy1339@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:55:19 -0400 Subject: [PATCH] maint: fix `__dirname` not defined in ESM --- script/sync.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/sync.ts b/script/sync.ts index e2d9dc102ee..48bf941618d 100644 --- a/script/sync.ts +++ b/script/sync.ts @@ -4,6 +4,9 @@ import { Octokit } from "@octokit/rest"; import * as YAML from "yaml"; import * as fs from "fs"; import { join, extname } from "path"; +import { fileURLToPath } from 'url'; + +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); function pad(number: number) { if (number < 10) {