fix(sdk): Coords trims leading @ from scope so callers can store either form

This commit is contained in:
Alex Dunmow 2026-06-03 07:03:19 +08:00
parent 12afdbd25e
commit 139d9b8543
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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
}