mirror of
https://github.com/GuDaStudio/codexmcp.git
synced 2026-10-12 12:59:57 +08:00
v0.4.6
This commit is contained in:
1 parent
d429757967
commit
4f746a757b
1 file changed
+6
-3
@@ -38,9 +38,12 @@ def run_shell_command(cmd: list[str]) -> Generator[str, None, None]:
|
||||
# user prompts containing quotes/newlines aren't reinterpreted as shell syntax.
|
||||
popen_cmd = cmd
|
||||
|
||||
codex_path = shutil.which('codex') or None # 替换运行路径
|
||||
if codex_path is not None:
|
||||
popen_cmd[0] = codex_path
|
||||
codex_path = shutil.which('codex') or cmd[0]
|
||||
popen_cmd[0] = codex_path
|
||||
|
||||
if os.name == "nt" and codex_path.lower().endswith((".cmd", ".bat")):
|
||||
from subprocess import list2cmdline
|
||||
popen_cmd = ["cmd.exe", "/s", "/c", list2cmdline(cmd)]
|
||||
|
||||
process = subprocess.Popen(
|
||||
popen_cmd,
|
||||
|
||||
Reference in new issue
Block a user