Skip to content

Commit 52f32bf

Browse files
silvanocerzaper1234
andcommitted
Code review fixes
Co-authored-by: per1234 <accounts@perglass.com>
1 parent 2af3de5 commit 52f32bf

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

cli/config/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var validMap = map[string]reflect.Kind{
3535
"metrics.enabled": reflect.Bool,
3636
"network.proxy": reflect.String,
3737
"network.user_agent_ext": reflect.String,
38-
"updater.disable_notification": reflect.Bool,
38+
"updater.enable_notification": reflect.Bool,
3939
}
4040

4141
func typeOf(key string) (reflect.Kind, error) {

cli/updater/updater.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
var tr = i18n.Tr
3434

3535
// CheckForUpdate returns the latest available version if greater than
36-
// the one running and it makes sense to check for an udpate, nil in all other cases
36+
// the one running and it makes sense to check for an update, nil in all other cases
3737
func CheckForUpdate(currentVersion *semver.Version) *semver.Version {
3838
if !shouldCheckForUpdate(currentVersion) {
3939
return nil
@@ -71,7 +71,7 @@ func checkForUpdate(currentVersion *semver.Version) *semver.Version {
7171
// NotifyNewVersionIsAvailable prints information about the new latestVersion
7272
func NotifyNewVersionIsAvailable(latestVersion string) {
7373
feedback.Errorf("\n\n%s %s → %s\n%s",
74-
ansi.Color(tr("A new release of arduino-cli is available:"), "yellow"),
74+
ansi.Color(tr("A new release of Arduino CLI is available:"), "yellow"),
7575
ansi.Color(globals.VersionInfo.VersionString, "cyan"),
7676
ansi.Color(latestVersion, "cyan"),
7777
ansi.Color("https://arduino.github.io/arduino-cli/latest/installation/#latest-packages", "yellow"))
@@ -85,8 +85,8 @@ func shouldCheckForUpdate(currentVersion *semver.Version) bool {
8585
return false
8686
}
8787

88-
if configuration.Settings.GetBool("updater.disable_notification") {
89-
// Don't check if the user disable the notification
88+
if !configuration.Settings.GetBool("updater.enable_notification") {
89+
// Don't check if the user disabled the notification
9090
return false
9191
}
9292

configuration/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func SetDefaults(settings *viper.Viper) {
5050
settings.SetDefault("metrics.addr", ":9090")
5151

5252
// updater settings
53-
settings.SetDefault("updater.disable_notification", false)
53+
settings.SetDefault("updater.enable_notification", true)
5454

5555
// Bind env vars
5656
settings.SetEnvPrefix("ARDUINO")

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- `always_export_binaries` - set to `true` to make [`arduino-cli compile`][arduino-cli compile] always save binaries
2626
to the sketch folder. This is the equivalent of using the [`--export-binaries`][arduino-cli compile options] flag.
2727
- `updater` - configuration options related to Arduino CLI updates
28-
- `disable_notification` - set to `true` to disable notifications of new Arduino CLI releases, defaults to `false`
28+
- `enable_notification` - set to `false` to disable notifications of new Arduino CLI releases, defaults to `true`
2929

3030
## Configuration methods
3131

docs/installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.
4141
```
4242

4343
The Arduino CLI verifies every 24 hours if there are new releases, if you don't like this behaviour you can disable it
44-
by setting the `updater.disable_notification` config or the env var `ARDUINO_UPDATER_DISABLE_NOTIFICATION` to `true`.
44+
by setting the [`updater.enable_notification` config](configuration.md#configuration-keys) or the
45+
[env var `ARDUINO_UPDATER_ENABLE_NOTIFICATION`](configuration.md#environment-variables) to `false`.
4546

4647
### Download
4748

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy