committed by
GitHub
parent
ad93f683be
commit
ce7af763bb
@@ -51,6 +51,11 @@ pub enum Step {
|
||||
Tldr,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug)]
|
||||
pub struct Composer {
|
||||
self_update: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, Debug)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
/// Configuration file
|
||||
@@ -73,6 +78,7 @@ pub struct ConfigFile {
|
||||
notify_each_step: Option<bool>,
|
||||
accept_all_windows_updates: Option<bool>,
|
||||
only: Option<Vec<Step>>,
|
||||
composer: Option<Composer>,
|
||||
}
|
||||
|
||||
impl ConfigFile {
|
||||
@@ -356,6 +362,15 @@ impl Config {
|
||||
self.config_file.accept_all_windows_updates.unwrap_or(true)
|
||||
}
|
||||
|
||||
/// Whether Composer should update itself
|
||||
pub fn composer_self_update(&self) -> bool {
|
||||
self.config_file
|
||||
.composer
|
||||
.as_ref()
|
||||
.and_then(|c| c.self_update)
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Whether to send a desktop notification at the beginning of every step
|
||||
#[allow(dead_code)]
|
||||
pub fn notify_each_step(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user