Skip to content

Commit

Permalink
'branch build': Invoke the 'Builder' tool
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkofler committed Oct 7, 2024
1 parent c4cd1b9 commit 477ca02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/bin/branch/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ use log::info;
use tooling::{
error::{Error, ErrorExt},
model::{Formula, ObjectCompression, ObjectDB, ObjectID},
tools::builder::Builder,
ODB_DEPTH,
};

use super::Cli;

/// The `ingest` command
/// The `build` command
#[derive(Parser)]
pub struct BuildCommand {
/// The compression to use for inserting the objects
#[arg(long, short, default_value_t=ObjectCompression::Xz)]
compression: ObjectCompression,

/// The file to the formula to be ingested
/// The object id of the formula to be built
formula: ObjectID,
}

Expand All @@ -30,7 +31,11 @@ impl BuildCommand {
let (formula, _object) =
Formula::from_odb(&self.formula, &object_db).ctx(|| "Recalling formula object")?;

println!("{:#?}", formula);
let home = cli.get_home()?;

let mut builder = Builder::new(&home, formula, &object_db).ctx(|| "Running the builder")?;

builder.run()?;

Ok(0)
}
Expand Down

0 comments on commit 477ca02

Please sign in to comment.