目录重构完成,但是Preview通道尚未可用
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user