This commit is contained in:
jamesk 2024-03-25 15:13:01 -04:00
parent 0f877fd0d0
commit df9ea5a855
3 changed files with 7 additions and 5 deletions

View File

@ -6,6 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Fasching = "0.1.18"
Fasching = "0.1.19"
#Fasching = {path = "../Fasching/"}
whoami = "1.5.1"

View File

@ -1,4 +1,5 @@
use Fasching::{create_snapshot, export_snapshot};
use Fasching::hasher::HashType;
use Fasching::hasher::HashType::BLAKE3;
use Fasching::snapshot::Snapshot;
use crate::syscompare::Comparer;
@ -15,8 +16,9 @@ impl CreateMode {
if snapshot_path.replace("./", "").is_empty() {
panic!("Specify output file name")
}
CreateMode { args, snapshot_path, root_path, snapshot: Default::default() }
let bind = root_path.clone();
let rp = bind.as_str();
CreateMode { args, snapshot_path, root_path, snapshot: create_snapshot(rp, HashType::MD5, vec![]) }
}
}
@ -25,6 +27,6 @@ impl Comparer for CreateMode {
let snapshot = create_snapshot(self.root_path.as_str(), BLAKE3, vec![]);
self.snapshot = snapshot.clone();
println!("Total FileHash Entries {}", snapshot.file_hashes.lock().unwrap().len());
let _ = export_snapshot(self.snapshot.clone(), self.snapshot_path.clone());
let _ = export_snapshot(self.snapshot.clone(), self.snapshot_path.clone(), true);
}
}

View File

@ -29,7 +29,7 @@ impl SysCompareApp {
None => {panic!("Missing hash dir path as second argument")}
Some(r) => {not_empty(r)}
};
let root_dir = match self.args.get(2) {
let root_dir = match self.args.get(3) {
None => {panic!("Missing hash dir path as second argument")}
Some(r) => {not_empty(r)}
};