feat: add advanced update management features
This commit is contained in:
@@ -8,9 +8,12 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
CheckAUR bool `json:"check_aur"`
|
||||
ReminderIntervalHours int `json:"reminder_interval_hours"`
|
||||
Terminal string `json:"terminal"`
|
||||
CheckAUR bool `json:"check_aur"`
|
||||
ReminderIntervalHours int `json:"reminder_interval_hours"`
|
||||
Terminal string `json:"terminal"`
|
||||
AutoRefreshMinutes int `json:"auto_refresh_minutes"`
|
||||
ShowIgnored bool `json:"show_ignored"`
|
||||
IgnoredPackages []string `json:"ignored_packages"`
|
||||
}
|
||||
|
||||
func Default() Config {
|
||||
@@ -18,6 +21,9 @@ func Default() Config {
|
||||
CheckAUR: true,
|
||||
ReminderIntervalHours: 168,
|
||||
Terminal: "auto",
|
||||
AutoRefreshMinutes: 30,
|
||||
ShowIgnored: false,
|
||||
IgnoredPackages: []string{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,5 +67,11 @@ func normalize(cfg Config) Config {
|
||||
if cfg.Terminal == "" {
|
||||
cfg.Terminal = Default().Terminal
|
||||
}
|
||||
if cfg.AutoRefreshMinutes < 0 {
|
||||
cfg.AutoRefreshMinutes = Default().AutoRefreshMinutes
|
||||
}
|
||||
if cfg.IgnoredPackages == nil {
|
||||
cfg.IgnoredPackages = []string{}
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user