Skip to content

Commit

Permalink
Merge pull request #24 from ibuildthecloud/main
Browse files Browse the repository at this point in the history
chore: use system path gptscript if python packaged one is missing
  • Loading branch information
ibuildthecloud authored Jun 24, 2024
2 parents 934a3d0 + 9e21355 commit 5cadd95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gptscript/gptscript.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import platform
import os
from socket import socket
from subprocess import Popen, PIPE
Expand Down Expand Up @@ -144,4 +145,8 @@ def _get_command():
if os.getenv("GPTSCRIPT_BIN") is not None:
return os.getenv("GPTSCRIPT_BIN")

return os.path.join(os.path.dirname(executable), "gptscript")
bin_path = os.path.join(os.path.dirname(executable), "gptscript")
if platform.system() == "Windows":
bin_path += ".exe"

return bin_path if os.path.exists(bin_path) else "gptscript"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ license = { file = "LICENSE" }
dependencies = [
"certifi==2024.2.2",
"charset-normalizer==3.3.2",
"httpx==0.27.0",
"idna==3.6",
"requests==2.31.0",
"tqdm==4.66.2",
Expand Down

0 comments on commit 5cadd95

Please sign in to comment.