Skip to content

Commit

Permalink
Invert conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
theodore-s-beers committed Feb 24, 2024
1 parent bcb6498 commit 9e2ebab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ fn main() -> Result<(), anyhow::Error> {

// If we have clear-cache flag, handle it and return
if clear_cache {
if cache_dir.exists() {
trash::delete(cache_dir)?;
eprintln!("Cache directory deleted");
return Ok(());
if !cache_dir.exists() {
return Err(anyhow!("Cache directory not found"));
}

return Err(anyhow!("Cache directory not found"));
trash::delete(cache_dir)?;
eprintln!("Cache directory deleted");
return Ok(());
}

// If we don't have the cache dir yet, try to create it
Expand Down

0 comments on commit 9e2ebab

Please sign in to comment.