Skip to content

Commit

Permalink
fix(foundry-compiler): was throwing error if no build info was alread…
Browse files Browse the repository at this point in the history
…y there
  • Loading branch information
0xmemorygrinder committed May 14, 2024
1 parent f8e7f52 commit 20d058f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libs/foundry-wrapper/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ pub enum Error {

#[error("Cannot read build info file")]
ReadBuildInfo(#[from] std::io::Error),

#[error("filesystem error: {0}")]
FileSystemError(std::io::Error),
}
7 changes: 6 additions & 1 deletion libs/foundry-wrapper/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ use std::path::PathBuf;
pub fn remove_previous_outputs(base_path: &str) -> Result<(), Error> {
let build_info_path = format!("{}/out/build-info", base_path);

remove_dir_all(&build_info_path)?;
let res = remove_dir_all(&build_info_path);
if let Err(e) = res {
if e.kind() != io::ErrorKind::NotFound {
return Err(Error::FileSystemError(e));
}
}
Ok(())
}

Expand Down

0 comments on commit 20d058f

Please sign in to comment.