CountCustomSettings returns the number of settings in the user's settings file. This excludes telemetry:enabled and autoupdate:channel which don't count as customizations.
()
| 981 | // CountCustomSettings returns the number of settings in the user's settings file. |
| 982 | // This excludes telemetry:enabled and autoupdate:channel which don't count as customizations. |
| 983 | func CountCustomSettings() int { |
| 984 | // Load user settings |
| 985 | userSettings, _ := ReadWaveHomeConfigFile("settings.json") |
| 986 | if userSettings == nil { |
| 987 | return 0 |
| 988 | } |
| 989 | |
| 990 | // Count all keys except telemetry:enabled and autoupdate:channel |
| 991 | count := 0 |
| 992 | for key := range userSettings { |
| 993 | if key == "telemetry:enabled" || key == "autoupdate:channel" { |
| 994 | continue |
| 995 | } |
| 996 | count++ |
| 997 | } |
| 998 | |
| 999 | return count |
| 1000 | } |
no test coverage detected