refactor(cli): sweep 15 bail("git X") sites to use git_run with context labels
This commit is contained in:
@@ -4,10 +4,8 @@ use anyhow::Result;
|
||||
|
||||
pub fn cmd_sync() -> Result<()> {
|
||||
let root = crate::helpers::vault_dir()?;
|
||||
let pull = crate::helpers::git_command(&root, &["pull", "--rebase"]).status()?;
|
||||
if !pull.success() { anyhow::bail!("git pull --rebase failed"); }
|
||||
let push = crate::helpers::git_command(&root, &["push"]).status()?;
|
||||
if !push.success() { anyhow::bail!("git push failed"); }
|
||||
crate::helpers::git_run(&root, &["pull", "--rebase"], "sync: git pull --rebase")?;
|
||||
crate::helpers::git_run(&root, &["push"], "sync: git push")?;
|
||||
eprintln!("Sync complete.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user