refactor(cli): move cmd_get/list/history/status/sync into commands/

This commit is contained in:
adlee-was-taken
2026-05-06 18:43:41 -04:00
parent 13c2fc2bd7
commit da7d7d162c
6 changed files with 286 additions and 268 deletions

View File

@@ -0,0 +1,13 @@
//! `relicario sync` — pull --rebase + push.
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"); }
eprintln!("Sync complete.");
Ok(())
}