Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit 3b877f8

Browse files
committed
fixed regression: accept empty version in 'core install'
1 parent 7399a45 commit 3b877f8

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

cli/core/update_index.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func runUpdateIndexCommand(cmd *cobra.Command, args []string) {
4949
Instance: instance,
5050
}, cli.OutputProgressBar())
5151
if err != nil {
52-
formatter.PrintError(err, "Error during install")
52+
formatter.PrintError(err, "Error updating index")
5353
os.Exit(cli.ErrGeneric)
5454
}
5555
}

commands/core/download.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ func PlatformDownload(ctx context.Context, req *rpc.PlatformDownloadReq, downloa
3636
}
3737

3838
var version *semver.Version
39-
if v, err := semver.Parse(req.Version); err == nil {
40-
version = v
41-
} else {
42-
return nil, fmt.Errorf("invalid version: %s", err)
39+
if req.GetVersion() != "" {
40+
if v, err := semver.Parse(req.GetVersion()); err == nil {
41+
version = v
42+
} else {
43+
return nil, fmt.Errorf("invalid version: %s", err)
44+
}
4345
}
4446

4547
platform, tools, err := pm.FindPlatformReleaseDependencies(&packagemanager.PlatformReference{

commands/core/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func PlatformInstall(ctx context.Context, req *rpc.PlatformInstallReq,
3838
}
3939

4040
var version *semver.Version
41-
if req.Version != "" {
42-
if v, err := semver.Parse(req.Version); err == nil {
41+
if req.GetVersion() != "" {
42+
if v, err := semver.Parse(req.GetVersion()); err == nil {
4343
version = v
4444
} else {
4545
return nil, fmt.Errorf("invalid version: %s", err)

commands/instances.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func UpdateLibrariesIndex(ctx context.Context, lm *librariesmanager.LibrariesMan
132132
if err != nil {
133133
return err
134134
}
135-
Download(d, "library_index.json", downloadCB)
135+
Download(d, "Updating index: library_index.json", downloadCB)
136136
if d.Error() != nil {
137137
return d.Error()
138138
}

0 commit comments

Comments
 (0)