diff options
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 44 |
1 files changed, 27 insertions, 17 deletions
@@ -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 |
