Skip to content

Commit

Permalink
Yes
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Feb 29, 2024
1 parent 3c57775 commit e761c84
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions crates/test_utils/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,23 @@ fn main() {
let status = child.wait();

// Filter out None values leaving behind Some(Path)
runner
.modified_file_paths
.into_iter()
.flatten()
.for_each(|path| {
let git_status = Command::new("git").args(["restore", &path]).output();
let paths: Vec<String> = runner.modified_file_paths.into_iter().flatten().collect();
let git_status = Command::new("git").arg("restore").args(&paths).output();

match git_status {
Ok(output) => {
if output.status.success() {
let stdout_str = String::from_utf8_lossy(&output.stdout);
println!("Git command executed successfully: {stdout_str}");
} else {
let stderr_str = String::from_utf8_lossy(&output.stderr);
eprintln!("Git command failed with error: {stderr_str}");
}
}
Err(e) => {
eprintln!("Error running Git: {e}");
}
match git_status {
Ok(output) => {
if output.status.success() {
let stdout_str = String::from_utf8_lossy(&output.stdout);
println!("Git command executed successfully: {stdout_str}");
} else {
let stderr_str = String::from_utf8_lossy(&output.stderr);
eprintln!("Git command failed with error: {stderr_str}");
}
});
}
Err(e) => {
eprintln!("Error running Git: {e}");
}
}

let exit_code = match status {
Ok(exit_status) => {
Expand Down

0 comments on commit e761c84

Please sign in to comment.