Skip to main content

helm_rs/command/render/
create.rs

1use std::path::PathBuf;
2
3use crate::backend::Command;
4
5/// `helm create` (`pkg/cmd/create.go`): scaffolds a chart directory and returns its path.
6#[derive(Debug, Clone, PartialEq, Eq, bon::Builder)]
7#[builder(on(PathBuf, into))]
8pub struct Create {
9    /// The `NAME` argument: the chart directory to create, named after its last component. Its
10    /// parent directory must exist (Helm 4.3 does not create it).
11    #[builder(start_fn)]
12    pub name: PathBuf,
13    /// Flag `--starter`: a starter scaffold, given by name (below `HELM_DATA_HOME/starters`) or by
14    /// absolute path.
15    pub starter: Option<PathBuf>,
16}
17
18impl Create {
19    /// A default scaffold at `name`.
20    #[must_use]
21    pub fn new(name: impl Into<PathBuf>) -> Self {
22        Self::builder(name).build()
23    }
24}
25
26impl Command for Create {
27    type Output = PathBuf;
28}