From 0882a934737dfa251e3d0415610859631ff1c2c4 Mon Sep 17 00:00:00 2001 From: astrochemx <105541001+astrochemx@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:52:18 +0200 Subject: [PATCH] fix: update `resolveBin` to use `fileURLToPath` for cross-platform compatibility --- src/utils/resolveBin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/resolveBin.ts b/src/utils/resolveBin.ts index f9f15f3f6..d5d33e58c 100644 --- a/src/utils/resolveBin.ts +++ b/src/utils/resolveBin.ts @@ -1,7 +1,9 @@ +import { fileURLToPath } from "node:url"; + // TODO: try to see if we can avoid this altogether... // https://github.com/JoshuaKGoldberg/create-typescript-app/issues/1992 export function resolveBin(bin: string) { // This can't be tested yet in Vitest :( // https://github.com/vitest-dev/vitest/issues/6953 - return import.meta.resolve(bin).replace(/^file:\/\//gu, ""); + return fileURLToPath(import.meta.resolve(bin)); }