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 == "" {
|
if mod.Plugin.Version == "" {
|
||||||
mod.Plugin.Version = "0.1.0"
|
mod.Plugin.Version = "0.1.0"
|
||||||
}
|
}
|
||||||
mod.Plugin.Scope = strings.TrimPrefix(scope, "@")
|
mod.Plugin.Scope = scope
|
||||||
mod.Plugin.Name = name
|
mod.Plugin.Name = name
|
||||||
mod.Plugin.Kind = kind
|
mod.Plugin.Kind = kind
|
||||||
mod.Plugin.Categories = categories
|
mod.Plugin.Categories = categories
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package plugin
|
package plugin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
tomlpkg "github.com/BurntSushi/toml"
|
tomlpkg "github.com/BurntSushi/toml"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -39,7 +41,7 @@ func (m *ModFile) Coords() string {
|
|||||||
if m == nil {
|
if m == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
scope := m.Plugin.Scope
|
scope := strings.TrimPrefix(m.Plugin.Scope, "@")
|
||||||
if scope == "" {
|
if scope == "" {
|
||||||
return m.Plugin.Name + "@" + m.Plugin.Version
|
return m.Plugin.Name + "@" + m.Plugin.Version
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user