mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-25 03:00:48 -05:00
25 lines
604 B
Go
25 lines
604 B
Go
package filepaths
|
|
|
|
import "strings"
|
|
|
|
func PluginAliasToShortName(pluginName string) string {
|
|
// remove prefix
|
|
split := strings.Split(pluginName, "/")
|
|
pluginName = split[len(split)-1]
|
|
|
|
if strings.HasPrefix(pluginName, "steampipe-plugin-") {
|
|
return strings.TrimPrefix(pluginName, "steampipe-plugin-")
|
|
}
|
|
return pluginName
|
|
}
|
|
func PluginAliasToLongName(pluginName string) string {
|
|
// remove prefix
|
|
split := strings.Split(pluginName, "/")
|
|
pluginName = split[len(split)-1]
|
|
|
|
if !strings.HasPrefix(pluginName, "steampipe-plugin-") {
|
|
return "steampipe-plugin-" + pluginName
|
|
}
|
|
return pluginName
|
|
}
|