Skip to content

Commit

Permalink
Stop the NodeCG install process if any files from the NodeCG archive …
Browse files Browse the repository at this point in the history
…couldn't be extracted
  • Loading branch information
inkfarer committed Apr 2, 2024
1 parent 7c01311 commit b980447
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src-tauri/src/nodecg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,19 @@ pub async fn install_nodecg(handle: tauri::AppHandle, path: String) -> Result<()
entry.unpack(&unpack_path)?;
Ok(())
})
.for_each(|x| {
if let Err(err) = x {
}) {
Ok(results) => {
let mut has_err = false;
results.for_each(|r| {
if let Err(err) = r {
logger.emit(&format!("Error unpacking file: {}", err.to_string()));
has_err = true;
}
});
}) {
Ok(_) => { },
if has_err {
return Err("Received one or more errors unpacking NodeCG archive".to_string())
}
},
Err(e) => return format_error("Failed to unpack archive", e)
}
logger.emit_progress(3);
Expand Down

0 comments on commit b980447

Please sign in to comment.