Skip to content

Commit 17a7f3f

Browse files
use feedback.PrintResult instead of using fatal
1 parent 074965d commit 17a7f3f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Diff for: internal/cli/core/upgrade.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool) {
110110
warningMissingIndex(response)
111111
if err != nil {
112112
if _, ok := err.(*arduino.PlatformAlreadyAtTheLatestVersionError); ok {
113-
feedback.Fatal(err.Error(), feedback.Success)
113+
feedback.Warning(err.Error())
114114
continue
115115
}
116116

@@ -121,4 +121,19 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool) {
121121
if hasBadArguments {
122122
feedback.Fatal(tr("Some upgrades failed, please check the output for details."), feedback.ErrBadArgument)
123123
}
124+
125+
feedback.PrintResult(&platformUpgradeResult{})
126+
}
127+
128+
// This is needed so we can print warning messages in case users use --format json
129+
type platformUpgradeResult struct{}
130+
131+
// Data implements feedback.Result.
132+
func (r *platformUpgradeResult) Data() interface{} {
133+
return r
134+
}
135+
136+
// String implements feedback.Result.
137+
func (r *platformUpgradeResult) String() string {
138+
return ""
124139
}

0 commit comments

Comments
 (0)