summaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorDoan Luu Duc Tai <doan@luuduct.ai>2026-11-01 07:13:45 -0600
committerDoan Luu Duc Tai <doan@luuduct.ai>2026-11-01 07:13:45 -0600
commit9349a2de648e241da8e00ba7ae25cb2a877ff3e9 (patch)
tree2fea913ee0aaff4370877f4a91c911db2fe37592 /src/app.rs
parent5b89c370d5974f057306a52089f14c337565fd1d (diff)
feat(guix): carry prebuilt runtime and recover preserved state
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs44
1 files changed, 27 insertions, 17 deletions
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<PathBuf>,
+ include_images: bool,
+ recipient: Option<String>,
+ 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