mirror of
https://github.com/qwjyh/xdbm
synced 2025-07-02 12:49:20 +09:00
new(sync): implement sync subcommand (WIP)
TODO - update CHANGELOG - refactor sync func
This commit is contained in:
parent
47b3a5e69d
commit
9316290d28
6 changed files with 137 additions and 19 deletions
15
tests/cli.rs
15
tests/cli.rs
|
@ -313,15 +313,14 @@ mod integrated_test {
|
|||
assert!(config_dir_2.join("backups").join("second.yml").exists());
|
||||
|
||||
// sync
|
||||
std::process::Command::new("git")
|
||||
.arg("push")
|
||||
.current_dir(&config_dir_2)
|
||||
Command::cargo_bin("xdbm")?
|
||||
.arg("-c")
|
||||
.arg(config_dir_2.path())
|
||||
.arg("sync")
|
||||
.arg("-vvvv")
|
||||
.assert()
|
||||
.success();
|
||||
// let repo_2 = Repository::open(config_dir_2)?;
|
||||
// // return Err(anyhow!("{:?}", repo_2.remotes()?.iter().collect::<Vec<_>>()));
|
||||
// let mut repo_2_remote = repo_2.find_remote(repo_2.remotes()?.get(0).unwrap())?;
|
||||
// repo_2_remote.push(&[] as &[&str], None)?;
|
||||
.success()
|
||||
.stderr(predicate::str::contains("successfully pushed"));
|
||||
std::process::Command::new("git")
|
||||
.arg("pull")
|
||||
.current_dir(&config_dir_1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue