Skip to content

Commit 5cadd95

Browse files
Merge pull request #24 from ibuildthecloud/main
chore: use system path gptscript if python packaged one is missing
2 parents 934a3d0 + 9e21355 commit 5cadd95

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-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"

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ license = { file = "LICENSE" }
1212
dependencies = [
1313
"certifi==2024.2.2",
1414
"charset-normalizer==3.3.2",
15+
"httpx==0.27.0",
1516
"idna==3.6",
1617
"requests==2.31.0",
1718
"tqdm==4.66.2",

0 commit comments

Comments
 (0)