[F] ?
This commit is contained in:
parent
713bcce0ec
commit
6ddd762b35
1 changed files with 14 additions and 2 deletions
|
|
@ -45,7 +45,19 @@ fn main() {
|
|||
let opt = CopyOptions { overwrite: true, copy_inside: true, ..CopyOptions::default() };
|
||||
fs_extra::dir::copy(&src, &dst, &opt).expect("Failed to copy directory to OUT_DIR");
|
||||
}
|
||||
else { fs::copy(&src, &dst).expect("Failed to copy file to OUT_DIR"); }
|
||||
else {
|
||||
// Check src exists
|
||||
if !src.exists() {
|
||||
panic!("Source file {} does not exist", src.display());
|
||||
}
|
||||
// Check dst parent exists
|
||||
if let Some(parent) = dst.parent() {
|
||||
if !parent.exists() {
|
||||
fs::create_dir_all(parent).expect("Failed to create parent directory for OUT_DIR");
|
||||
}
|
||||
}
|
||||
fs::copy(&src, &dst).expect("Failed to copy file to OUT_DIR");
|
||||
}
|
||||
}
|
||||
|
||||
export_distros(&o.join("neofetch"), &o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue