Auto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum

Use Build::read_dir instead of fs::read_dir in Build::cp_r

Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.
This commit is contained in:
bors 2019-06-10 02:35:29 +00:00
commit ad3829fd66

View file

@ -1214,8 +1214,7 @@ impl Build {
/// when this function is called.
pub fn cp_r(&self, src: &Path, dst: &Path) {
if self.config.dry_run { return; }
for f in t!(fs::read_dir(src)) {
let f = t!(f);
for f in self.read_dir(src) {
let path = f.path();
let name = path.file_name().unwrap();
let dst = dst.join(name);