mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-03 15:53:56 +00:00
fix: use platformBinaries for bundle skip (keep main.lua/SKILL.md)
This commit is contained in:
@ -37,7 +37,7 @@ func platformBinary() (zipName, canonicalName string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// validBinaries 是 .hmap 中所有可识别的平台二进制文件名。
|
// validBinaries 是 .hmap 中所有可识别的文件入口(平台二进制或脚本)。
|
||||||
var validBinaries = map[string]bool{
|
var validBinaries = map[string]bool{
|
||||||
"plugin.so": true,
|
"plugin.so": true,
|
||||||
"plugin.dylib": true,
|
"plugin.dylib": true,
|
||||||
@ -46,6 +46,13 @@ var validBinaries = map[string]bool{
|
|||||||
"SKILL.md": true,
|
"SKILL.md": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// platformBinaries 是平台特定的二进制,bundle 模式下仅当前平台的被解压。
|
||||||
|
var platformBinaries = map[string]bool{
|
||||||
|
"plugin.so": true,
|
||||||
|
"plugin.dylib": true,
|
||||||
|
"plugin.dll": true,
|
||||||
|
}
|
||||||
|
|
||||||
var downloadClient = &http.Client{
|
var downloadClient = &http.Client{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: 30 * time.Second,
|
||||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||||
@ -647,8 +654,8 @@ func extractPackage(data []byte, pluginDir string) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// bundle mode: skip other platforms' binaries, keep only current OS
|
// bundle mode: skip other platforms' platform-specific binaries
|
||||||
if isBundle && validBinaries[f.Name] && f.Name != zipBin {
|
if isBundle && platformBinaries[f.Name] && f.Name != zipBin {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user