Skip to content

Commit

Permalink
store the template in the template files too
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Feb 24, 2025
1 parent 25d3d23 commit 8b32d36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 0 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ fn main() {
continue;
}

if path.file_name() == Some(std::ffi::OsStr::new("template.yaml")) {
continue;
}

println!("{:?} {}", path, relative_path);
let content = std::fs::read_to_string(path).unwrap();

Expand Down
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ mod template_files;
mod tui;

static TEMPLATE: LazyLock<Template> = LazyLock::new(|| {
let options = include_str!("../template/template.yaml");
serde_yaml::from_str(options).unwrap()
serde_yaml::from_str(
template_files::TEMPLATE_FILES
.iter()
.find_map(|(k, v)| if *k == "template.yaml" { Some(v) } else { None })
.unwrap(),
)
.unwrap()
});

#[derive(Parser, Debug)]
Expand Down

0 comments on commit 8b32d36

Please sign in to comment.