Skip to content

Commit

Permalink
check source_path before delete it (solana-labs#33255)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihau authored Sep 14, 2023
1 parent 596e17f commit 99b24bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/cargo-build-sbf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ fn install_if_missing(
let source_base = config.sbf_sdk.join("dependencies");
if source_base.exists() {
let source_path = source_base.join(package);
debug!("Remove file {:?}", source_path);
fs::remove_file(source_path).map_err(|err| err.to_string())?;
if source_path.exists() {
debug!("Remove file {:?}", source_path);
fs::remove_file(source_path).map_err(|err| err.to_string())?;
}
}
}
// Check whether the target path is an empty directory. This can
Expand Down

0 comments on commit 99b24bd

Please sign in to comment.