refactor(config): move sudo_command to section misc (#484)
This commit is contained in:
@@ -370,6 +370,8 @@ pub struct Vim {
|
|||||||
pub struct Misc {
|
pub struct Misc {
|
||||||
pre_sudo: Option<bool>,
|
pre_sudo: Option<bool>,
|
||||||
|
|
||||||
|
sudo_command: Option<SudoKind>,
|
||||||
|
|
||||||
#[merge(strategy = crate::utils::merge_strategies::vec_prepend_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::vec_prepend_opt)]
|
||||||
git_repos: Option<Vec<String>>,
|
git_repos: Option<Vec<String>>,
|
||||||
|
|
||||||
@@ -440,8 +442,6 @@ pub struct ConfigFile {
|
|||||||
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
|
||||||
misc: Option<Misc>,
|
misc: Option<Misc>,
|
||||||
|
|
||||||
sudo_command: Option<SudoKind>,
|
|
||||||
|
|
||||||
#[merge(strategy = crate::utils::merge_strategies::commands_merge_opt)]
|
#[merge(strategy = crate::utils::merge_strategies::commands_merge_opt)]
|
||||||
pre_commands: Option<Commands>,
|
pre_commands: Option<Commands>,
|
||||||
|
|
||||||
@@ -1389,7 +1389,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn sudo_command(&self) -> Option<SudoKind> {
|
pub fn sudo_command(&self) -> Option<SudoKind> {
|
||||||
self.config_file.sudo_command
|
self.config_file.misc.as_ref().and_then(|misc| misc.sudo_command)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If `true`, `sudo` should be called after `pre_commands` in order to elevate at the
|
/// If `true`, `sudo` should be called after `pre_commands` in order to elevate at the
|
||||||
|
|||||||
Reference in New Issue
Block a user