feat(cli): relicario sync — pull --rebase then push via hardened git

This commit is contained in:
adlee-was-taken
2026-04-20 17:31:45 -04:00
parent 10f249d95e
commit a3871ac890

View File

@@ -1243,7 +1243,15 @@ fn cmd_settings(action: SettingsAction) -> Result<()> {
eprintln!("Settings updated.");
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"); }
#[derive(serde::Serialize)]