MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / pluginIDFromPath

Function pluginIDFromPath

internal/homeplugins/sync.go:373–386  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

371}
372
373func pluginIDFromPath(path string) string {
374 file, ok := pluginFileFromPath(path, "")
375 if ok {
376 return file.ID
377 }
378 base := filepath.Base(path)
379 lowerBase := strings.ToLower(base)
380 for _, extension := range []string{".so", ".dylib", ".dll"} {
381 if strings.HasSuffix(lowerBase, extension) {
382 return base[:len(base)-len(extension)]
383 }
384 }
385 return base
386}
387
388func pluginFileFromPath(filePath string, requiredExtension string) (pluginFileInfo, bool) {
389 base := filepath.Base(filePath)

Callers

nothing calls this directly

Calls 1

pluginFileFromPathFunction · 0.70

Tested by

no test coverage detected