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

Function pluginIDFromPath

internal/pluginstore/install.go:457–470  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

455}
456
457func pluginIDFromPath(path string) string {
458 file, ok := pluginFileInfoFromPath(path, "")
459 if ok {
460 return file.ID
461 }
462 base := filepath.Base(path)
463 lowerBase := strings.ToLower(base)
464 for _, extension := range []string{".so", ".dylib", ".dll"} {
465 if strings.HasSuffix(lowerBase, extension) {
466 return base[:len(base)-len(extension)]
467 }
468 }
469 return base
470}
471
472func pluginFileInfoFromPath(filePath string, requiredExtension string) (pluginFileInfo, bool) {
473 base := filepath.Base(filePath)

Callers

nothing calls this directly

Calls 1

pluginFileInfoFromPathFunction · 0.85

Tested by

no test coverage detected