diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-01-03 06:16:07 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-01-03 06:16:07 +0000 |
commit | 0734368d45b349a6ab433c1d41f35a95ea58c9ec (patch) | |
tree | b69c6b84b9ce025d6f7afd92d734452757f4f365 /src/doc.rs | |
parent | e8082fef03bd04042dad3fb2d0513587c54874ab (diff) | |
parent | b9de4d5e810d07b679ad9ab9e46d58e4c76213cc (diff) | |
download | subplot-0734368d45b349a6ab433c1d41f35a95ea58c9ec.tar.gz |
Merge branch 'more-rust-subplots' into 'main'
codegen: Refuse to generate code if the specified template is not present
Closes #259
See merge request subplot/subplot!242
Diffstat (limited to 'src/doc.rs')
-rw-r--r-- | src/doc.rs | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -559,6 +559,9 @@ pub fn codegen(filename: &Path, output: &Path, template: Option<&str>) -> Result .unwrap_or_else(|| doc.template())? .to_string(); event!(Level::TRACE, ?template); + if !doc.meta().templates().any(|t| t == template) { + return Err(SubplotError::TemplateSupportNotPresent); + } if !doc.check_named_files_exist(&template)? || !doc.check_matched_steps_have_impl(&template) || !doc.check_embedded_files_are_used(&template)? |