feat(checks): Add new finction
diff - function which cheks differencies between 2 repo
This commit is contained in:
1 parent
24c9d2e5a9
commit
559af7d594
1 file changed
+17
@@ -0,0 +1,17 @@
|
||||
use super::*;
|
||||
use crate::rclone_install::RcloneApp;
|
||||
use serde_json::Value;
|
||||
|
||||
/// Проверить разницу между двумя директориями
|
||||
pub fn diff(app: &RcloneApp, source: &str, dest: &str) -> Result<Vec<String>, String> {
|
||||
let output = app.run_command(&["check", source, dest, "--combined", "-"])?;
|
||||
|
||||
let mut differences = Vec::new();
|
||||
for line in output.lines() {
|
||||
if !line.is_empty() {
|
||||
differences.push(line.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(differences)
|
||||
}
|
||||
Reference in new issue
Block a user