mirror of
https://codeberg.org/demostf/cleanup.git
synced 2026-06-03 18:14:09 +02:00
dont die on missing files
This commit is contained in:
parent
3612400d7d
commit
74a6f35106
1 changed files with 8 additions and 7 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -50,17 +50,18 @@ async fn main() -> Result<(), MainError> {
|
||||||
.trim_start_matches("demos/"),
|
.trim_start_matches("demos/"),
|
||||||
);
|
);
|
||||||
|
|
||||||
if !path.exists() {
|
|
||||||
error!(path = ?path, "Demo not found");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
info!("removing");
|
info!("removing");
|
||||||
client
|
client
|
||||||
.set_url(demo.id, "deleted", "", "", demo.hash, &api_key)
|
.set_url(demo.id, "deleted", "", "", demo.hash, &api_key)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
||||||
|
if !path.exists() {
|
||||||
|
error!(path = ?path, "File not found");
|
||||||
|
} else {
|
||||||
remove_file(&path)?;
|
remove_file(&path)?;
|
||||||
info!("{} {}", demo.id, demo.name);
|
info!(name = demo.name, "removed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue