diff --git a/src/config.rs b/src/config.rs index 33c17d83..65ae0eda 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1607,8 +1607,7 @@ impl Config { 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 - /// start of the session (and not in the middle). + /// If `true`, `sudo -v` should be called to cache credentials at the start of the run pub fn pre_sudo(&self) -> bool { self.config_file .misc diff --git a/src/main.rs b/src/main.rs index b13f58d5..fb7a35f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -206,18 +206,18 @@ fn run() -> Result<()> { None }; - if let Some(commands) = config.pre_commands() { - for (name, command) in commands { - generic::run_custom_command(name, command, &ctx)?; - } - } - if config.pre_sudo() { if let Some(sudo) = ctx.sudo() { sudo.elevate(&ctx)?; } } + if let Some(commands) = config.pre_commands() { + for (name, command) in commands { + generic::run_custom_command(name, command, &ctx)?; + } + } + for step in step::default_steps() { step.run(&mut runner, &ctx)? }