MCPcopy
hub / github.com/helm/helm / stripPluginName

Function stripPluginName

internal/plugin/installer/extractor.go:185–195  ·  view source on GitHub ↗

stripPluginName is a helper that relies on some sort of convention for plugin name (plugin-name- )

(name string)

Source from the content-addressed store, hash-verified

183
184// stripPluginName is a helper that relies on some sort of convention for plugin name (plugin-name-<version>)
185func stripPluginName(name string) string {
186 var strippedName string
187 for suffix := range Extractors {
188 if before, ok := strings.CutSuffix(name, suffix); ok {
189 strippedName = before
190 break
191 }
192 }
193 re := regexp.MustCompile(`(.*)-[0-9]+\..*`)
194 return re.ReplaceAllString(strippedName, `$1`)
195}

Callers 4

TestStripNameFunction · 0.85
installFromArchiveMethod · 0.85
PathMethod · 0.85
NewHTTPInstallerFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestStripNameFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…