Browse Source

If hard-linking fails, try to copy (in assemble())

add-rc-path
Konstantin Welke 9 years ago
parent
commit
c3479fbc1a
  1. 5
      src/lib.rs

5
src/lib.rs

@ -468,7 +468,10 @@ impl Config {
// exist for now.
let lib_dst = dst.with_file_name(format!("{}.lib", lib_name));
let _ = fs::remove_file(&lib_dst);
fs::hard_link(dst, lib_dst).unwrap();
if fs::hard_link(&dst, &lib_dst).is_err() {
println!("Hard-linking from {:?} to {:?} failed. Trying to copy...", dst, lib_dst);
fs::copy(&dst, &lib_dst).expect("Copying from {:?} to {:?} FAILED.");
};
} else {
let ar = self.get_ar();
let cmd = ar.file_name().unwrap().to_string_lossy();

Loading…
Cancel
Save