Fix hak script import in tsx esm for Windows (#2125)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-02-05 14:50:39 +00:00 committed by GitHub
parent 0ae3f235b7
commit 687e89f54f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,8 @@ async function main(): Promise<void> {
for (const s of HAKSCRIPTS) {
if (hakJson.scripts?.[s]) {
const scriptModule = await import(path.join("file://", prefix, "hak", dep, hakJson.scripts[s]));
// Shockingly, using path.join and backslashes here doesn't work on Windows
const scriptModule = await import(`../../hak/${dep}/${hakJson.scripts[s]}`);
if (scriptModule.default) {
deps[dep].scripts[s] = scriptModule.default;
} else {