Closed
Description
Describe the problem
% arduino-cli core upgrade arduino:avr
Error during upgrade: Platform '' is already at the latest version
Empty string is used in the message.
To reproduce
see above
Expected behavior
- I'd expect the error message to contain the name of the platform.
- Bonus points if it contains also the current version number, which helps a lot in troubleshooting.
- I wonder if printing an error and exiting with 130 is the right thing here. A common pattern for
upgrade
commands in many tools is to say "xxx is already at the latest version" and exit with 0, thus adopting the "no-op" semantics rather than "failure".
For instance,brew upgrade arduino-cli
prints "Warning: arduino-cli 0.31.0 already installed" and exits with 0.apt-get upgrade arduino-cli
does the same.
The advantage of the no-op semantics is that in a script you can assume that exit code == 0 means that the resource is now up-to-date (regardless of whether an upgrade was performed now). With the current behavior of arduino-cli, non-zero exit code may mean both temporary failure or package up-to-date which is ambiguous in the context of the caller script.)
Arduino CLI version
arduino-cli Version: 0.31.0 Commit: 940c945 Date: 2023-02-20T15:09:19Z
Operating system
macOS
Operating system version
10.15.7
Additional context
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details