File tree 2 files changed +7
-6
lines changed
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) {
38
38
for _ , platform := range targetPackage .Platforms {
39
39
platformRelease := packageManager .GetInstalledPlatformRelease (platform )
40
40
41
+ // The All flags adds to the list of installed platforms the installable platforms (from the indexes)
41
42
// If both All and UpdatableOnly are set All takes precedence
42
43
if req .All {
43
44
installedVersion := ""
44
- if platformRelease == nil {
45
+ if platformRelease == nil { // if the platform is not installed
45
46
platformRelease = platform .GetLatestRelease ()
46
47
} else {
47
48
installedVersion = platformRelease .Version .String ()
48
49
}
50
+ // it could happen, especially with indexes not perfectly compliant with specs that a platform do not contain a valid release
49
51
if platformRelease != nil {
50
52
rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
51
53
rpcPlatform .Installed = installedVersion
@@ -60,10 +62,9 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
60
62
return nil , & arduino.PlatformNotFoundError {Platform : platform .String (), Cause : fmt .Errorf (tr ("the platform has no releases" ))}
61
63
}
62
64
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
67
68
}
68
69
69
70
rpcPlatform := commands .PlatformReleaseToRPC (platformRelease )
Original file line number Diff line number Diff line change @@ -3297,7 +3297,7 @@ msgstr "testing local archive integrity: %s"
3297
3297
msgid "text section exceeds available space in board"
3298
3298
msgstr "text section exceeds available space in board"
3299
3299
3300
- #: commands/core/list.go:60
3300
+ #: commands/core/list.go:62
3301
3301
msgid "the platform has no releases"
3302
3302
msgstr "the platform has no releases"
3303
3303
You can’t perform that action at this time.
0 commit comments