Skip to content

Commit

Permalink
fix: errors caused by hyphen support after upgrading to v0.5.5 (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoli0605 authored Sep 28, 2024
1 parent 8968974 commit c9d1e06
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,17 +581,17 @@ func (b *Sdk) GetLocalSdkPackage(version Version) (*Package, error) {
}
for _, d := range dir {
if d.IsDir() {
split := strings.SplitN(d.Name(), "-", 2)
if len(split) != 2 {
continue
}
name := split[0]
v := split[1]
logger.Debugf("Load SDK package item: name:%s, version: %s \n", name, v)
items[name] = &Info{
Name: name,
Version: Version(v),
Path: filepath.Join(versionPath, d.Name()),
if strings.HasSuffix(d.Name(), string(version)) {
name := strings.TrimSuffix(d.Name(), "-"+string(version))
if name == "" {
continue
}
logger.Debugf("Load SDK package item: name:%s, version: %s \n", name, version)
items[name] = &Info{
Name: name,
Version: Version(version),
Path: filepath.Join(versionPath, d.Name()),
}
}
}
}
Expand Down

0 comments on commit c9d1e06

Please sign in to comment.