Skip to content

Commit

Permalink
Print path on metadata call failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Keats committed Apr 26, 2022
1 parent c14b1fa commit 6851ade
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/utils/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ pub fn copy_file_if_needed(src: &Path, dest: &Path, hard_link: bool) -> Result<(
if hard_link {
std::fs::hard_link(src, dest)?
} else {
let src_metadata = metadata(src)?;
let src_metadata = metadata(src).with_context(|| {
format!("Failed to get metadata of {}", src.display())
})?;
let src_mtime = FileTime::from_last_modification_time(&src_metadata);
if Path::new(&dest).is_file() {
let target_metadata = metadata(&dest)?;
Expand Down

0 comments on commit 6851ade

Please sign in to comment.