File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -38,14 +38,16 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
3838 for _ , platform := range targetPackage .Platforms {
3939 platformRelease := packageManager .GetInstalledPlatformRelease (platform )
4040
41+ // The All flags adds to the list of installed platforms the installable platforms (from the indexes)
4142 // If both All and UpdatableOnly are set All takes precedence
4243 if req .All {
4344 installedVersion := ""
44- if platformRelease == nil {
45+ if platformRelease == nil { // if the platform is not installed
4546 platformRelease = platform .GetLatestRelease ()
4647 } else {
4748 installedVersion = platformRelease .Version .String ()
4849 }
50+ // it could happen, especially with indexes not perfectly compliant with specs that a platform do not contain a valid release
4951 if platformRelease != nil {
5052 rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
5153 rpcPlatform .Installed = installedVersion
@@ -60,10 +62,9 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
6062 return nil , & arduino.PlatformNotFoundError {Platform : platform .String (), Cause : fmt .Errorf (tr ("the platform has no releases" ))}
6163 }
6264
63- if req .UpdatableOnly {
64- if latest == platformRelease {
65- continue
66- }
65+ // show only the updatable platforms
66+ if req .UpdatableOnly && latest == platformRelease {
67+ continue
6768 }
6869
6970 rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
Original file line number Diff line number Diff line change @@ -3297,7 +3297,7 @@ msgstr "testing local archive integrity: %s"
32973297msgid "text section exceeds available space in board"
32983298msgstr "text section exceeds available space in board"
32993299
3300- #: commands/core/list.go:60
3300+ #: commands/core/list.go:62
33013301msgid "the platform has no releases"
33023302msgstr "the platform has no releases"
33033303
You can’t perform that action at this time.
0 commit comments