|
|
@ -122,13 +122,18 @@ impl DirEntry {
|
|
|
|
match self {
|
|
|
|
match self {
|
|
|
|
DirEntry::File(file) => file.apply(cwd),
|
|
|
|
DirEntry::File(file) => file.apply(cwd),
|
|
|
|
DirEntry::Dir(p, children) => {
|
|
|
|
DirEntry::Dir(p, children) => {
|
|
|
|
let cwd = cwd.join(p.file_name().unwrap());
|
|
|
|
let cwd = if p != cwd {
|
|
|
|
if !cwd.exists() {
|
|
|
|
let cwd = cwd.join(p.file_name().unwrap());
|
|
|
|
log::info!("Creating {cwd:?}");
|
|
|
|
if !cwd.exists() {
|
|
|
|
fs::create_dir_all(&cwd)
|
|
|
|
log::info!("Creating {cwd:?}");
|
|
|
|
.into_diagnostic()
|
|
|
|
fs::create_dir_all(&cwd)
|
|
|
|
.with_context(|| format!("Creating directory {cwd:?}"))?;
|
|
|
|
.into_diagnostic()
|
|
|
|
}
|
|
|
|
.with_context(|| format!("Creating directory {cwd:?}"))?;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cwd
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
p.to_owned()
|
|
|
|
|
|
|
|
};
|
|
|
|
for child in children {
|
|
|
|
for child in children {
|
|
|
|
child.apply(&cwd)?;
|
|
|
|
child.apply(&cwd)?;
|
|
|
|
}
|
|
|
|
}
|
|
|
|