Skip to content

Commit

Permalink
cli: Add build-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrero committed Dec 5, 2023
1 parent b101d9d commit a970031
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ pub(crate) enum Opt {
/// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
#[clap(alias = "usroverlay")]
UsrOverlay,
/// Validate non supported files are not present.
BuildCommit,
/// Install to the target block device
#[cfg(feature = "install")]
Install(crate::install::InstallOpts),
Expand Down Expand Up @@ -436,6 +438,15 @@ async fn usroverlay() -> Result<()> {
.into());
}

/// Implementation of `bootc build commit`
async fn commit() -> Result<()> {
// This is just a pass-through today. At some point we may diverge from ostree-ext.
return Err(Command::new("ostree")
.args(["container", "commit"])
.exec()
.into());
}

/// Parse the provided arguments and execute.
/// Calls [`structopt::clap::Error::exit`] on failure, printing the error message and aborting the program.
pub async fn run_from_iter<I>(args: I) -> Result<()>
Expand All @@ -453,6 +464,7 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
Opt::Switch(opts) => switch(opts).await,
Opt::Edit(opts) => edit(opts).await,
Opt::UsrOverlay => usroverlay().await,
Opt::BuildCommit => commit().await,
#[cfg(feature = "install")]
Opt::Install(opts) => crate::install::install(opts).await,
#[cfg(feature = "install")]
Expand Down

0 comments on commit a970031

Please sign in to comment.