Skip to content

Commit 5cb315f

Browse files
bug: don't match archive with glob
In the current directory is the archive (gptscript...tar.gz) and the binary (gptscript or gptscript.exe). The current approach will sometimes match the archive. By removing '*' it will look for the exact filename.
1 parent 97a47fa commit 5cb315f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

gptscript/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def install():
150150

151151
# Find the extracted binary and rename/move it to the versioned name in the python bin directory
152152
extracted_binary_path = next(
153-
output_dir.glob(gptscript_binary_name + "*"), None
153+
output_dir.glob(gptscript_binary_name), None
154154
) # Adjust the glob pattern if necessary
155155
if extracted_binary_path:
156156
shutil.move(str(extracted_binary_path), str(versioned_binary_path))

tests/test_gptscript.py

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from gptscript.confirm import AuthResponse
77
from gptscript.frame import RunEventType, CallFrame, RunFrame, RunState, PromptFrame
88
from gptscript.gptscript import GPTScript
9+
from gptscript.install import install, gptscript_binary_name, python_bin_dir
910
from gptscript.opts import GlobalOptions, Options
1011
from gptscript.prompt import PromptResponse
1112
from gptscript.run import Run
@@ -77,6 +78,12 @@ def tool_list():
7778
]
7879

7980

81+
def test_install():
82+
install()
83+
p = python_bin_dir / gptscript_binary_name
84+
os.system(str(p))
85+
86+
8087
@pytest.mark.asyncio
8188
async def test_create_another_gptscript():
8289
g = GPTScript()

0 commit comments

Comments
 (0)