Skip to content

chore: use system path gptscript if python packaged one is missing #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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