Skip to main content

harmont_cli/commands/cache/
save.rs

1use std::path::Path;
2
3use anyhow::Result;
4
5/// Save cached VM snapshots to a directory for CI warm-start.
6///
7/// This is a placeholder after the Docker-to-VM migration. The VM
8/// backend manages snapshots internally via `ImageRegistry`; external
9/// save/restore is not yet implemented.
10///
11/// # Errors
12///
13/// Currently always succeeds.
14#[allow(clippy::print_stdout)]
15pub async fn handle_save(dir: &Path) -> Result<i32> {
16    tracing::info!(
17        path = %dir.display(),
18        "cache save is not yet implemented for the VM backend",
19    );
20    // Print an empty hash so callers that capture stdout don't break.
21    println!("0000000000000000");
22    Ok(2)
23}