Added init command.
This commit is contained in:
parent
4fb6c7b497
commit
cc172fa1df
|
@ -55,7 +55,7 @@ pub type ConfigFileTasks = HashMap<String, String>;
|
||||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||||
pub struct ConfigFile {
|
pub struct ConfigFile {
|
||||||
pub(crate) name: String,
|
pub(crate) name: String,
|
||||||
#[serde(default, skip_serializing_if = "is_auto_task_engine")]
|
#[serde(default, skip_serializing_if = "is_default_task_engine")]
|
||||||
pub(crate) task_engine: TaskEngine,
|
pub(crate) task_engine: TaskEngine,
|
||||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||||
pub(crate) directories: Vec<String>,
|
pub(crate) directories: Vec<String>,
|
||||||
|
@ -68,8 +68,9 @@ pub struct ConfigFile {
|
||||||
pub(crate) __dir_path: PathBuf,
|
pub(crate) __dir_path: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_auto_task_engine(value: &TaskEngine) -> bool {
|
fn is_default_task_engine(value: &TaskEngine) -> bool {
|
||||||
match value {
|
match value {
|
||||||
|
// Changing the default is generally discouraged.
|
||||||
TaskEngine::AUTO => true,
|
TaskEngine::AUTO => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue