From edb1e171e50a869417e23f04e696e74b269bc38e Mon Sep 17 00:00:00 2001 From: Miroslav Drbal Date: Sun, 10 May 2026 16:50:44 +0200 Subject: [PATCH] fix(scripts): use import.meta.dir instead of URL.pathname for Windows compatibility new URL(...).pathname returns a POSIX-style /D:/... path on Windows, which is not a valid filesystem path. import.meta.dir gives the correct native path on all platforms. --- packages/coding-agent/scripts/format-prompts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/coding-agent/scripts/format-prompts.ts b/packages/coding-agent/scripts/format-prompts.ts index 6973d4089..8f03700a3 100644 --- a/packages/coding-agent/scripts/format-prompts.ts +++ b/packages/coding-agent/scripts/format-prompts.ts @@ -16,9 +16,9 @@ import { prompt } from "@oh-my-pi/pi-utils"; */ import { Glob } from "bun"; -const PROMPTS_DIR = new URL("../src/prompts/", import.meta.url).pathname; -const COMMIT_PROMPTS_DIR = new URL("../src/commit/prompts/", import.meta.url).pathname; -const AGENTIC_PROMPTS_DIR = new URL("../src/commit/agentic/prompts/", import.meta.url).pathname; +const PROMPTS_DIR = import.meta.dir + "/../src/prompts/"; +const COMMIT_PROMPTS_DIR = import.meta.dir + "/../src/commit/prompts/"; +const AGENTIC_PROMPTS_DIR = import.meta.dir + "/../src/commit/agentic/prompts/"; const PROMPT_DIRS = [PROMPTS_DIR, COMMIT_PROMPTS_DIR, AGENTIC_PROMPTS_DIR];