Print path on metadata call failure
This commit is contained in:
parent
c14b1fa746
commit
6851ade642
|
@ -88,7 +88,9 @@ pub fn copy_file_if_needed(src: &Path, dest: &Path, hard_link: bool) -> Result<(
|
||||||
if hard_link {
|
if hard_link {
|
||||||
std::fs::hard_link(src, dest)?
|
std::fs::hard_link(src, dest)?
|
||||||
} else {
|
} 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);
|
let src_mtime = FileTime::from_last_modification_time(&src_metadata);
|
||||||
if Path::new(&dest).is_file() {
|
if Path::new(&dest).is_file() {
|
||||||
let target_metadata = metadata(&dest)?;
|
let target_metadata = metadata(&dest)?;
|
||||||
|
|
Loading…
Reference in New Issue