feat(client+scripts): release 本地真测 — local_test.sh + 内核查找加 /opt/homebrew
- scripts/local_test.sh:一键构建 release macOS 包 + 配 sing-box 免密 sudoers (TUN 需 root)+ 前台运行真身(日志直出),让本地测试 = release 线上行为 - kernel_process 二进制查找兜底加 /opt/homebrew/bin/sing-box(Apple Silicon brew),release 包从 Finder/直接启动也能找到内核,免设 PANGOLIN_SINGBOX_BIN Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
// 2. <executable dir>/sing-box (或 .exe)
|
||||
// 3. <executable dir>/../../Resources/sing-box (macOS .app bundle)
|
||||
// 4. <project>/app/kernel/dist/desktop/<os>-<arch>/sing-box (开发目录)
|
||||
// 5. /usr/local/bin/sing-box
|
||||
// 5. /opt/homebrew/bin/sing-box (Apple Silicon brew)
|
||||
// 6. /usr/local/bin/sing-box (Intel brew / Linux)
|
||||
// · 配置 Clash API 端口: 由 spawn 调用方(DesktopVpnBridge)写入配置,
|
||||
// 或从配置文件读 experimental.clash_api.external_controller
|
||||
//
|
||||
@@ -601,9 +602,13 @@ class DesktopKernelProcess implements KernelProcess {
|
||||
}
|
||||
}
|
||||
|
||||
// 系统 PATH 兜底
|
||||
const fallback = '/usr/local/bin/sing-box';
|
||||
if (await File(fallback).exists()) return fallback;
|
||||
// 系统常见安装路径兜底(Apple Silicon brew / Intel·Linux brew)
|
||||
for (final fallback in const [
|
||||
'/opt/homebrew/bin/sing-box',
|
||||
'/usr/local/bin/sing-box',
|
||||
]) {
|
||||
if (await File(fallback).exists()) return fallback;
|
||||
}
|
||||
|
||||
throw FileSystemException(
|
||||
'sing-box binary not found. '
|
||||
|
||||
Reference in New Issue
Block a user