fix(sdk): Coords trims leading @ from scope so callers can store either form
This commit is contained in:
parent
12afdbd25e
commit
139d9b8543
@ -558,7 +558,7 @@ func upsertPluginMod(scope, name, kind string, categories []string) error {
|
||||
if mod.Plugin.Version == "" {
|
||||
mod.Plugin.Version = "0.1.0"
|
||||
}
|
||||
mod.Plugin.Scope = strings.TrimPrefix(scope, "@")
|
||||
mod.Plugin.Scope = scope
|
||||
mod.Plugin.Name = name
|
||||
mod.Plugin.Kind = kind
|
||||
mod.Plugin.Categories = categories
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
tomlpkg "github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
@ -39,7 +41,7 @@ func (m *ModFile) Coords() string {
|
||||
if m == nil {
|
||||
return ""
|
||||
}
|
||||
scope := m.Plugin.Scope
|
||||
scope := strings.TrimPrefix(m.Plugin.Scope, "@")
|
||||
if scope == "" {
|
||||
return m.Plugin.Name + "@" + m.Plugin.Version
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user