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.
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user