Skip to content

Commit dbee121

Browse files
chore: use system path gptscript if python packaged one is missing
1 parent 3e8cd9e commit dbee121

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gptscript/gptscript.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import platform
23
import os
34
from socket import socket
45
from subprocess import Popen, PIPE
@@ -144,4 +145,8 @@ def _get_command():
144145
if os.getenv("GPTSCRIPT_BIN") is not None:
145146
return os.getenv("GPTSCRIPT_BIN")
146147

147-
return os.path.join(os.path.dirname(executable), "gptscript")
148+
bin_path = os.path.join(os.path.dirname(executable), "gptscript")
149+
if platform.system() == "Windows":
150+
bin_path += ".exe"
151+
152+
return bin_path if os.path.exists(bin_path) else "gptscript"

0 commit comments

Comments
 (0)