目录重构完成,但是Preview通道尚未可用

This commit is contained in:
2026-08-07 19:42:49 +08:00
parent 3a381c85ed
commit 86df4bf3c5
16 changed files with 1620 additions and 24 deletions
-3
View File
@@ -50,14 +50,12 @@ func GetFrpcPath() (string, error) {
return "", fmt.Errorf("不支持的平台: %s/%s", runtime.GOOS, runtime.GOARCH)
}
// 尝试从本地 bin 目录加载
localPath := filepath.Join(".", "bin", fileName)
if _, err := os.Stat(localPath); err == nil {
cachedFrpcPath = localPath
return localPath, nil
}
// 尝试从 embed 提取到临时目录
data, err := embeddedFrpc.ReadFile("bin/" + fileName)
if err == nil {
tmpPath := filepath.Join(os.TempDir(), "frpc")
@@ -74,7 +72,6 @@ func GetFrpcPath() (string, error) {
}
}
// 最后尝试从系统 PATH 查找
path, err := exec.LookPath("frpc")
if err == nil {
cachedFrpcPath = path