|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
use std::fs::{copy as fscopy, read_dir};
|
|
|
|
|
use std::fs::read_dir;
|
|
|
|
|
use std::os::unix::fs::PermissionsExt;
|
|
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
|
|
use crate::config::Config;
|
|
|
|
|
use crate::error::*;
|
|
|
|
|
use crate::util::{get_perms, mkdir, set_perms};
|
|
|
|
|
use crate::util::{copy_file, get_perms, mkdir, set_perms};
|
|
|
|
|
|
|
|
|
|
pub fn copy(config: &Config) -> MkrootResult<()> {
|
|
|
|
|
if config.verbose {
|
|
|
|
@ -91,16 +91,3 @@ fn copy_dir(src: &PathBuf, dst: &PathBuf, verbose: bool) -> MkrootResult<()> {
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn copy_file(src: &PathBuf, dst: &PathBuf) -> MkrootResult<()> {
|
|
|
|
|
if let Err(e) = fscopy(src, dst) {
|
|
|
|
|
return Err(MkrootError::from(format!(
|
|
|
|
|
"Error copying file from {} to {}: {}",
|
|
|
|
|
src.display(),
|
|
|
|
|
dst.display(),
|
|
|
|
|
e
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|