feat(cli): relicario sync — pull --rebase then push via hardened git
This commit is contained in:
@@ -1243,7 +1243,15 @@ fn cmd_settings(action: SettingsAction) -> Result<()> {
|
|||||||
eprintln!("Settings updated.");
|
eprintln!("Settings updated.");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn cmd_sync() -> Result<()> { bail!("not yet implemented"); }
|
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"); }
|
||||||
|
eprintln!("Sync complete.");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
fn cmd_device(_a: DeviceAction) -> Result<()> { bail!("not yet implemented"); }
|
fn cmd_device(_a: DeviceAction) -> Result<()> { bail!("not yet implemented"); }
|
||||||
|
|
||||||
#[derive(serde::Serialize)]
|
#[derive(serde::Serialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user