feat: run pre_sudo before pre_commands (#1469)

This commit is contained in:
Andre Toerien
2025-11-11 17:17:00 +02:00
committed by GitHub
parent ec8d30f634
commit bb4afb71e9
2 changed files with 7 additions and 8 deletions

View File

@@ -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)?
}