Execution Context

This commit is contained in:
Roey Darwish Dror
2020-02-08 22:13:56 +02:00
committed by GitHub
parent fb5cf5c176
commit c716b68e9c
3 changed files with 69 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
use crate::error::{SkipStep, TopgradeError};
use crate::execution_context::ExecutionContext;
use crate::executor::{CommandExt, RunType};
use crate::terminal::{print_separator, shell};
use crate::utils::{self, PathExt};
@@ -166,9 +167,9 @@ pub fn run_myrepos_update(base_dirs: &BaseDirs, run_type: RunType) -> Result<()>
.check_run()
}
pub fn run_custom_command(name: &str, command: &str, run_type: RunType) -> Result<()> {
pub fn run_custom_command(name: &str, command: &str, ctx: &ExecutionContext) -> Result<()> {
print_separator(name);
run_type.execute(shell()).arg("-c").arg(command).check_run()
ctx.run_type().execute(shell()).arg("-c").arg(command).check_run()
}
pub fn run_composer_update(base_dirs: &BaseDirs, run_type: RunType) -> Result<()> {