@@ -269,6 +269,7 @@ pub struct Vim {
|
||||
#[serde(deny_unknown_fields)]
|
||||
/// Configuration file
|
||||
pub struct ConfigFile {
|
||||
pre_sudo: Option<bool>,
|
||||
pre_commands: Option<Commands>,
|
||||
post_commands: Option<Commands>,
|
||||
commands: Option<Commands>,
|
||||
@@ -947,6 +948,12 @@ impl Config {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// If `true`, `sudo` should be called after `pre_commands` in order to elevate at the
|
||||
/// start of the session (and not in the middle).
|
||||
pub fn pre_sudo(&self) -> bool {
|
||||
self.config_file.pre_sudo.unwrap_or(false)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn npm_use_sudo(&self) -> bool {
|
||||
self.config_file
|
||||
|
||||
Reference in New Issue
Block a user