Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
81fa396f
Unverified
Commit
81fa396f
authored
Jul 18, 2019
by
Massimiliano Pippi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return a specific error if core is up to date
parent
189737a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
commands/core/upgrade.go
commands/core/upgrade.go
+7
-1
No files found.
commands/core/upgrade.go
View file @
81fa396f
...
...
@@ -28,6 +28,12 @@ import (
rpc
"github.com/arduino/arduino-cli/rpc/commands"
)
var
(
// ErrAlreadyLatest is returned when an upgrade is not possible because
// already at latest version.
ErrAlreadyLatest
=
errors
.
New
(
"platform already at latest version"
)
)
// PlatformUpgrade FIXMEDOC
func
PlatformUpgrade
(
ctx
context
.
Context
,
req
*
rpc
.
PlatformUpgradeReq
,
downloadCB
commands
.
DownloadProgressCB
,
taskCB
commands
.
TaskProgressCB
,
downloaderHeaders
http
.
Header
)
(
*
rpc
.
PlatformUpgradeResp
,
error
)
{
...
...
@@ -71,7 +77,7 @@ func upgradePlatform(pm *packagemanager.PackageManager, platformRef *packagemana
}
latest
:=
platform
.
GetLatestRelease
()
if
!
latest
.
Version
.
GreaterThan
(
installed
.
Version
)
{
return
fmt
.
Errorf
(
"platform %s is already at the latest version"
,
platformRef
)
return
ErrAlreadyLatest
}
platformRef
.
PlatformVersion
=
latest
.
Version
toInstallRefs
=
append
(
toInstallRefs
,
platformRef
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment