Skip to content

Commit

Permalink
moss/cli/install: Record new state when done
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <ikey@serpentos.com>
  • Loading branch information
ikeycode committed Oct 10, 2023
1 parent c27a1fa commit ab5cdd6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions moss/src/cli/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub async fn handle(args: &ArgMatches) -> Result<(), Error> {
print_to_columns(&results);
println!();

let state_ids = results.iter().map(|p| p.id.clone()).collect_vec();
let multi_progress = MultiProgress::new();

let total_progress = multi_progress.add(
Expand Down Expand Up @@ -207,6 +208,12 @@ pub async fn handle(args: &ArgMatches) -> Result<(), Error> {
.try_collect()
.await?;

// Perfect, record state.
client
.state_db
.add(state_ids.as_slice(), None, None)
.await?;

// Remove progress
multi_progress.clear()?;

Expand Down Expand Up @@ -239,6 +246,9 @@ pub enum Error {
#[error("layoutdb error: {0}")]
LayoutDB(#[from] moss::db::layout::Error),

#[error("statedb error: {0}")]
StateDB(#[from] moss::db::state::Error),

#[error("io error: {0}")]
Io(#[from] std::io::Error),
}

0 comments on commit ab5cdd6

Please sign in to comment.