Skip to content

Commit

Permalink
fix clean erroring on not found
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored May 2, 2024
1 parent a99b828 commit e4f03c1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/soroban-cli/src/commands/cache/clean.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fs;
use std::{fs, io::ErrorKind};

use super::super::config::locator;
use crate::commands::config::data;
Expand All @@ -21,7 +21,10 @@ impl Cmd {
pub fn run(&self) -> Result<(), Error> {
let binding = data::project_dir()?;
let dir = binding.data_dir();
fs::remove_dir_all(dir)?;
match fs::remove_dir_all(dir) {
Err(err) if err.kind() == ErrorKind::NotFound => (),
r => r?,
}
Ok(())
}
}

0 comments on commit e4f03c1

Please sign in to comment.