Skip to content

Commit 20d058f

Browse files
fix(foundry-compiler): was throwing error if no build info was already there
1 parent f8e7f52 commit 20d058f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

libs/foundry-wrapper/src/error.rs

+3
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ pub enum Error {
2828

2929
#[error("Cannot read build info file")]
3030
ReadBuildInfo(#[from] std::io::Error),
31+
32+
#[error("filesystem error: {0}")]
33+
FileSystemError(std::io::Error),
3134
}

libs/foundry-wrapper/src/output.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ use std::path::PathBuf;
99
pub fn remove_previous_outputs(base_path: &str) -> Result<(), Error> {
1010
let build_info_path = format!("{}/out/build-info", base_path);
1111

12-
remove_dir_all(&build_info_path)?;
12+
let res = remove_dir_all(&build_info_path);
13+
if let Err(e) = res {
14+
if e.kind() != io::ErrorKind::NotFound {
15+
return Err(Error::FileSystemError(e));
16+
}
17+
}
1318
Ok(())
1419
}
1520

0 commit comments

Comments
 (0)