boostrap: dist: if a file cannot be installed because it does not exist, print its name in the error message.

This commit is contained in:
Matthias Krüger 2018-10-13 23:33:10 +02:00
parent 8f19cadf95
commit da1c75c3a6

View File

@ -1288,6 +1288,9 @@ impl Build {
t!(fs::create_dir_all(dstdir));
drop(fs::remove_file(&dst));
{
if !src.exists() {
panic!("Error: File \"{}\" not found!", src.display());
}
let mut s = t!(fs::File::open(&src));
let mut d = t!(fs::File::create(&dst));
io::copy(&mut s, &mut d).expect("failed to copy");