Skip to content

Conversation

@stahiga
Copy link

@stahiga stahiga commented Dec 28, 2025

In certain environments (e.g., ubuntu desktop minimal), /usr/local/bin does not exist.
In such cases,installing fails to place the xray binary while not halting the script execution.
This PR adds a check to create the directory before installing the binary.

某些环境下/usr/local/bin没有被预安装。
这时脚本在执行安装xray binary逻辑时,会失败但不报错。
现在在install逻辑前增加了目录检查,如果目录不存在则创建。

@Meo597
Copy link
Contributor

Meo597 commented Dec 28, 2025

Alpine不可能有这种问题,不应该检查

@stahiga
Copy link
Author

stahiga commented Dec 28, 2025

这个修改是因为一个新环境安装(Ubuntu desktop minimal)中遇到的问题,
表明该目录在某些发行版中有不存在的可能,所以在安装逻辑中增加了目录检查。

Alpine 脚本只是保持一致性地采用了相同逻辑,已在 Alpine 镜像上验证可以正常运行。

@Fangliding
Copy link
Member

minimal的Ubuntu docker映像78.1MB都有这个文件夹 很难想象desktop minimal能没有
我搜了一下网上好像 类似的报错极度稀少且基本来自macos(显然不属于这个脚本的支持范围)
你确定没有这个文件夹是你使用的发行版预期的?你可以提供信息吗

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.

3 participants