mirror of
https://codeberg.org/demostf/cleanup.git
synced 2026-06-03 10:04:10 +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/"),
|
||||
);
|
||||
|
||||
if !path.exists() {
|
||||
error!(path = ?path, "Demo not found");
|
||||
break;
|
||||
}
|
||||
|
||||
info!("removing");
|
||||
client
|
||||
.set_url(demo.id, "deleted", "", "", demo.hash, &api_key)
|
||||
.await?;
|
||||
|
||||
|
||||
if !path.exists() {
|
||||
error!(path = ?path, "File not found");
|
||||
} else {
|
||||
remove_file(&path)?;
|
||||
info!("{} {}", demo.id, demo.name);
|
||||
info!(name = demo.name, "removed");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue