m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-16 17:13:46 -05:00

feat: add ability to ignore certain update types (#91)

This commit is contained in:
Seow Alex
2025-04-12 14:37:28 +08:00
committed by GitHub
parent efea81ef39
commit 80a295680d
4 changed files with 68 additions and 5 deletions

View File

@@ -6,10 +6,9 @@ use serde::Deserialize;
use crate::error;
#[derive(Clone, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum Theme {
#[serde(rename = "default")]
Default,
#[serde(rename = "blue")]
Blue,
}
@@ -19,6 +18,21 @@ impl Default for Theme {
}
}
#[derive(Clone, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum UpdateType {
None,
Major,
Minor,
Patch,
}
impl Default for UpdateType {
fn default() -> Self {
Self::None
}
}
#[derive(Clone, Deserialize, Default)]
#[serde(deny_unknown_fields)]
#[serde(default)]
@@ -40,6 +54,7 @@ pub struct ImageConfig {
pub struct Config {
version: u8,
pub agent: bool,
pub ignore_update_type: UpdateType,
pub images: ImageConfig,
pub refresh_interval: Option<String>,
pub registries: FxHashMap<String, RegistryConfig>,
@@ -53,6 +68,7 @@ impl Config {
Self {
version: 3,
agent: false,
ignore_update_type: UpdateType::default(),
images: ImageConfig::default(),
refresh_interval: None,
registries: FxHashMap::default(),