diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | build.rs | 6 | ||||
| -rw-r--r-- | src/cmd/cmd_system.rs | 6 | ||||
| -rw-r--r-- | templates/renderer_list.rs.template (renamed from templates/renderer_list.txt) | 4 |
4 files changed, 7 insertions, 11 deletions
@@ -24,4 +24,4 @@ /src/data/compile_info.rs /setup/windows/setup_jv_cli.iss /src/cmd/cmds/_registry.rs -/src/cmd/renderers/renderer_list.txt +/src/cmd/renderers/renderer_list.rs @@ -11,8 +11,8 @@ const SETUP_JV_CLI_ISS_TEMPLATE: &str = "./templates/setup_jv_cli.iss"; const REGISTRY_RS: &str = "./src/cmd/cmds/_registry.rs"; const REGISTRY_RS_TEMPLATE: &str = "./templates/_registry.rs.template"; -const RENDERER_LIST_TEMPLATE: &str = "./templates/renderer_list.txt"; -const RENDERER_LIST: &str = "./src/cmd/renderers/renderer_list.txt"; +const RENDERER_LIST_TEMPLATE: &str = "./templates/renderer_list.rs.template"; +const RENDERER_LIST: &str = "./src/cmd/renderers/renderer_list.rs"; const REGISTRY_TOML: &str = "./Registry.toml"; @@ -387,7 +387,7 @@ fn generate_renderer_list_file(repo_root: &PathBuf) -> Result<(), Box<dyn std::e .map(|(name, renderer_type)| { renderer_template .replace("<<NAME>>", name) - .replace("<<TYPE>>", renderer_type) + .replace("RendererType", renderer_type) .trim_matches('\n') .to_string() }) diff --git a/src/cmd/cmd_system.rs b/src/cmd/cmd_system.rs index 229c7f0..9696947 100644 --- a/src/cmd/cmd_system.rs +++ b/src/cmd/cmd_system.rs @@ -25,7 +25,6 @@ where fn get_help_str() -> String; /// Process the command with a specified renderer, performing any necessary post-execution processing - #[rustfmt::skip] fn process_with_renderer_flag( args: Vec<String>, ctx: JVCommandContext, @@ -36,10 +35,7 @@ where { async move { let renderer_str = renderer.as_str(); - include!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/src/cmd/renderers/renderer_list.txt" - )) + include!("renderers/renderer_list.rs") } } diff --git a/templates/renderer_list.txt b/templates/renderer_list.rs.template index cfc8105..37f0f1b 100644 --- a/templates/renderer_list.txt +++ b/templates/renderer_list.rs.template @@ -3,14 +3,14 @@ match renderer_str { // -- TEMPLATE START -- "<<NAME>>" => { Self::process_with_renderer::< - <<TYPE>>, + RendererType >(args, ctx) .await } // -- TEMPLATE END -- _ => { return Err(CmdProcessError::Render(CmdRenderError::RendererNotFound( - renderer, + renderer_str.to_string(), ))); } } |
