hexz_cli/cmd/data/
pull.rs1use anyhow::{Context, Result};
4use colored::Colorize;
5use super::workspace::Workspace;
6
7pub fn run(remote: &str) -> Result<()> {
9 let ws = Workspace::find(&std::env::current_dir()?)?
10 .context("Not in a hexz workspace (no .hexz found)")?;
11
12 let url = ws.config.remotes.get(remote).with_context(|| {
13 format!("Remote '{remote}' not found. Add it with `hexz remote add {remote} <url>`")
14 })?;
15
16 println!("{} Pulling from {}", "╭".dimmed(), remote.magenta());
17 println!("{} URL {}", "╰".dimmed(), url.bright_black());
18
19 println!("\n {} Fetching remote manifest...", "→".yellow());
20 println!(" {} Downloading delta blocks...", "→".yellow());
21
22 println!("\n {} Pull complete.", "✓".green());
29 Ok(())
30}