fix nonexistent paths

work
Avril 4 years ago
parent d158a3d347
commit f715b54dcd
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -0,0 +1,2 @@
Add lolistealer-like async progress bar handler to State (check state.rs)

@ -37,10 +37,6 @@ async fn process_single(state: Arc<state::State>, path: impl AsRef<Path>) -> eyr
let _g = state.lock().await;
debug!("{:?} Processing", path);
//TODO: Actual processing
if path.as_os_str().len() > 100 {
//panic!("FUCK WHY ISN'T THIS SHIT RAN!??!??!?!??!??!");
return Err(eyre!("Test termination"));
}
Ok(())
}

@ -76,9 +76,15 @@ async fn process_mock(state: Arc<state::State>, file: String)
async fn process(state: Arc<state::State>, file: String) -> eyre::Result<()>
{
delete::process(state, &file).await
.wrap_err(eyre!("Processing failed"))
.with_section(move || file.header("Root path was"))?;
let path = std::path::Path::new(&file);
if !path.exists() {
error!("{:?} does not exist, skipping", path);
} else {
info!("{:?} Processing", path);
delete::process(state, path).await
.wrap_err(eyre!("Processing failed"))
.with_section(move || file.header("Root path was"))?;
}
Ok(())
}

@ -14,6 +14,7 @@ use futures::{
};
/// Contains state for a set of operations
//TODO: Add progress bar handler in here, when we get around to adding it.
#[derive(Debug)]
pub struct State
{

Loading…
Cancel
Save