mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
no output for dependency and backup actions
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use patch_db::HasModel;
|
use patch_db::HasModel;
|
||||||
|
use regex::NoExpand;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::action::ActionImplementation;
|
use crate::action::{ActionImplementation, NoOutput};
|
||||||
use crate::context::RpcContext;
|
use crate::context::RpcContext;
|
||||||
use crate::s9pk::manifest::PackageId;
|
use crate::s9pk::manifest::PackageId;
|
||||||
use crate::util::Version;
|
use crate::util::Version;
|
||||||
@@ -21,7 +22,7 @@ impl BackupActions {
|
|||||||
pkg_id: &PackageId,
|
pkg_id: &PackageId,
|
||||||
pkg_version: &Version,
|
pkg_version: &Version,
|
||||||
volumes: &Volumes,
|
volumes: &Volumes,
|
||||||
) -> Result<(), Error> {
|
) -> Result<NoOutput, Error> {
|
||||||
let mut volumes = volumes.to_readonly();
|
let mut volumes = volumes.to_readonly();
|
||||||
volumes.insert(VolumeId::Backup, Volume::Backup { readonly: false });
|
volumes.insert(VolumeId::Backup, Volume::Backup { readonly: false });
|
||||||
self.create
|
self.create
|
||||||
@@ -37,7 +38,7 @@ impl BackupActions {
|
|||||||
.await?
|
.await?
|
||||||
.map_err(|e| anyhow!("{}", e.1))
|
.map_err(|e| anyhow!("{}", e.1))
|
||||||
.with_kind(crate::ErrorKind::Backup)?;
|
.with_kind(crate::ErrorKind::Backup)?;
|
||||||
Ok(())
|
Ok(NoOutput)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn restore(
|
pub async fn restore(
|
||||||
@@ -46,7 +47,7 @@ impl BackupActions {
|
|||||||
pkg_id: &PackageId,
|
pkg_id: &PackageId,
|
||||||
pkg_version: &Version,
|
pkg_version: &Version,
|
||||||
volumes: &Volumes,
|
volumes: &Volumes,
|
||||||
) -> Result<(), Error> {
|
) -> Result<NoOutput, Error> {
|
||||||
let mut volumes = volumes.clone();
|
let mut volumes = volumes.clone();
|
||||||
volumes.insert(VolumeId::Backup, Volume::Backup { readonly: true });
|
volumes.insert(VolumeId::Backup, Volume::Backup { readonly: true });
|
||||||
self.restore
|
self.restore
|
||||||
@@ -62,6 +63,6 @@ impl BackupActions {
|
|||||||
.await?
|
.await?
|
||||||
.map_err(|e| anyhow!("{}", e.1))
|
.map_err(|e| anyhow!("{}", e.1))
|
||||||
.with_kind(crate::ErrorKind::Restore)?;
|
.with_kind(crate::ErrorKind::Restore)?;
|
||||||
Ok(())
|
Ok(NoOutput)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use indexmap::IndexMap;
|
|||||||
use patch_db::{DbHandle, DiffPatch, HasModel, Map, MapModel};
|
use patch_db::{DbHandle, DiffPatch, HasModel, Map, MapModel};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::action::ActionImplementation;
|
use crate::action::{ActionImplementation, NoOutput};
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::context::RpcContext;
|
use crate::context::RpcContext;
|
||||||
use crate::db::model::CurrentDependencyInfo;
|
use crate::db::model::CurrentDependencyInfo;
|
||||||
@@ -226,7 +226,7 @@ impl DependencyConfig {
|
|||||||
dependent_version: &Version,
|
dependent_version: &Version,
|
||||||
dependent_volumes: &Volumes,
|
dependent_volumes: &Volumes,
|
||||||
dependency_config: &Config,
|
dependency_config: &Config,
|
||||||
) -> Result<Result<(), String>, Error> {
|
) -> Result<Result<NoOutput, String>, Error> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.check
|
.check
|
||||||
.sandboxed(
|
.sandboxed(
|
||||||
|
|||||||
Reference in New Issue
Block a user