From a3871ac890348fb449c8d0e1d2944cf9c6a9444b Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Mon, 20 Apr 2026 17:31:45 -0400 Subject: [PATCH] =?UTF-8?q?feat(cli):=20relicario=20sync=20=E2=80=94=20pul?= =?UTF-8?q?l=20--rebase=20then=20push=20via=20hardened=20git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/relicario-cli/src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/relicario-cli/src/main.rs b/crates/relicario-cli/src/main.rs index 6ca47e6..0495954 100644 --- a/crates/relicario-cli/src/main.rs +++ b/crates/relicario-cli/src/main.rs @@ -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)]