feat: make sure dir is there as well
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
31
cuddle/src/cli/subcommands/render.rs
Normal file
31
cuddle/src/cli/subcommands/render.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use clap::{ArgMatches, Command};
|
||||
|
||||
use crate::cli::CuddleCli;
|
||||
|
||||
use super::{folder::FolderCommand, kustomize::KustomizeCommand};
|
||||
|
||||
pub fn build_command(root_cmd: Command) -> Command {
|
||||
let cmd = Command::new("render").about("accesses different render commands");
|
||||
|
||||
let cmd = super::kustomize::build_command(cmd);
|
||||
let cmd = super::folder::build_command(cmd);
|
||||
|
||||
root_cmd.subcommand(cmd)
|
||||
}
|
||||
|
||||
pub struct RenderCommand {}
|
||||
impl RenderCommand {
|
||||
pub fn execute(matches: &ArgMatches, cli: CuddleCli) -> anyhow::Result<()> {
|
||||
match matches.subcommand() {
|
||||
Some(("kustomize", sub_matches)) => {
|
||||
KustomizeCommand::from_matches(sub_matches, cli)?.execute()?;
|
||||
}
|
||||
Some(("folder", sub_matches)) => {
|
||||
FolderCommand::from_matches(sub_matches, cli)?.execute()?;
|
||||
}
|
||||
_ => anyhow::bail!("failed to find match for render"),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user