move_it/
lib.rs

1//! It moves files from one folder to an other.
2
3#[macro_use]
4extern crate lazy_static;
5
6mod result;
7mod work;
8
9pub use work::Work;
10
11// async fn test(from: impl Into<String>, to: impl Into<String>) -> Result<()> {
12//     Work::new()
13//         .all_files_recursive(from)?
14//         .include(r"/test2")?
15//         .exclude(r"/test3")?
16//         .echo(to)?
17//         .execute()
18//         .await?;
19
20//     Ok(())
21// }
22
23// pub fn mv(from: String, to: String) {
24//     let start = std::time::Instant::now();
25//     env_logger::Builder::from_default_env()
26//         .format(move |buf, rec| {
27//             let t = start.elapsed().as_secs_f32();
28//             writeln!(buf, "{:.03} [{}] - {}", t, rec.level(), rec.args())
29//         })
30//         .init();
31
32//     let mut rt = tokio::runtime::Runtime::new().unwrap();
33
34//     match rt.block_on(test(from, to)) {
35//         Ok(_) => info!("Done"),
36//         Err(e) => error!("An error ocurred: {}", e),
37//     };
38// }