Skip to content

fix(cmd/start): use absolute executable path for child process#2125

Open
abcqqoo wants to merge 1 commit intoOpenListTeam:mainfrom
abcqqoo:fix/windows-start-executable-path
Open

fix(cmd/start): use absolute executable path for child process#2125
abcqqoo wants to merge 1 commit intoOpenListTeam:mainfrom
abcqqoo:fix/windows-start-executable-path

Conversation

@abcqqoo
Copy link

@abcqqoo abcqqoo commented Feb 15, 2026

Description / 描述

  • start 命令启动子进程时使用的路径从 os.Args[0] 改为 os.Executable()
  • 透传 start 后的用户参数(os.Args[2:])给 server
  • 当已传入 --force-bin-dir 时不再重复追加。

Motivation and Context / 背景

在 Windows 上,当添加了可执行文件目录环境变量后,从非可执行文件目录调用 openlist start 时,os.Args[0] 可能是相对路径(如 .\openlist),导致子进程启动失败:
exec: ".\\openlist": executable file not found in %PATH%

How Has This Been Tested? / 测试

在非可执行文件目录执行 openlist start,确认不再出现 exec: ".\\openlist": executable file not found in %PATH%,确认 start 能成功拉起子进程(日志显示 success start pid)。

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant