Skip to content

Commit b4d8c27

Browse files
committed
fix: remove reference to __dirname
The builtin __dirname is not available for ES modules.
1 parent 4f8b66d commit b4d8c27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gptscript.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,8 @@ async function getCmdPath(): Promise<string> {
773773
}
774774

775775
const path = await import("path")
776-
return path.join(__dirname, "..", "bin", "gptscript")
776+
const url = await import("url")
777+
return path.join(path.dirname(url.fileURLToPath(import.meta.url)), "..", "bin", "gptscript")
777778
}
778779

779780
export function listTools(gptscriptURL?: string): Promise<string> {

0 commit comments

Comments
 (0)