From 9349a2de648e241da8e00ba7ae25cb2a877ff3e9 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Sun, 1 Nov 2026 07:13:45 -0600 Subject: feat(guix): carry prebuilt runtime and recover preserved state --- src/app.rs | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index d655774..02f91ee 100644 --- a/src/app.rs +++ b/src/app.rs @@ -61,9 +61,10 @@ fn execute(arguments: Cli) -> Result<()> { if let Action::Restore { archive, destination, + release, } = &arguments.command { - return archive::restore(&absolute(archive)?, &absolute(destination)?); + return archive::restore(&absolute(archive)?, &absolute(destination)?, *release); } let project = Project::discover(arguments.root.as_deref())?; if let Action::Chat { @@ -132,22 +133,13 @@ fn execute(arguments: Cli) -> Result<()> { include_images, recipient, key, - } => { - let output = destination.map_or_else( - || Ok(project.root.join("var/exports")), - |path| absolute(&path), - )?; - let configuration = stack_config::Config::load(&project.root)?; - let selected_recipient = - recipient.unwrap_or(configuration.value("BACKUP_RECIPIENT")?.to_owned()); - archive::backup( - &project, - &output, - include_images, - &selected_recipient, - key.as_deref(), - ) - } + } => backup( + &project, + destination, + include_images, + recipient, + key.as_deref(), + ), Action::Release { destination } => { let output = destination .map_or_else(|| Ok(project.root.join("dist")), |path| absolute(&path))?; @@ -161,6 +153,23 @@ fn execute(arguments: Cli) -> Result<()> { } } +fn backup( + project: &Project, + destination: Option, + include_images: bool, + recipient: Option, + key: Option<&Path>, +) -> Result<()> { + let output = destination.map_or_else( + || Ok(project.root.join("var/exports")), + |path| absolute(&path), + )?; + let configuration = stack_config::Config::load(&project.root)?; + let selected_recipient = + recipient.unwrap_or(configuration.value("BACKUP_RECIPIENT")?.to_owned()); + archive::backup(project, &output, include_images, &selected_recipient, key) +} + fn chat( project: &Project, init: bool, @@ -207,6 +216,7 @@ fn licenses(project: &Project) -> Result<()> { } fn check(project: &Project) -> Result<()> { + process::run(project.command("sh")?.arg("infra/guix/test.sh"))?; process::run(project.command("sh")?.arg("infra/chat/build-typescript.sh"))?; process::run( project -- cgit v1.2.3