mk_lib/schema/
include.rs

1use serde::Deserialize;
2
3#[derive(Debug, Deserialize)]
4pub struct IncludeArgs {
5  pub name: String,
6
7  #[serde(default)]
8  pub overwrite: bool,
9}
10
11#[derive(Debug, Deserialize)]
12#[serde(untagged)]
13pub enum Include {
14  String(String),
15  Include(Box<IncludeArgs>),
16}
17
18impl Include {
19  pub fn capture(&self) -> anyhow::Result<()> {
20    match self {
21      Include::String(name) => self.capture_root(name),
22      Include::Include(args) => args.capture_root(),
23    }
24  }
25
26  fn capture_root(&self, name: &str) -> anyhow::Result<()> {
27    IncludeArgs {
28      name: name.to_string(),
29      overwrite: false,
30    }
31    .capture_root()
32  }
33}
34
35impl IncludeArgs {
36  pub fn capture_root(&self) -> anyhow::Result<()> {
37    unimplemented!()
38  }
39}