pub fn select_template_source(
config_path: impl AsRef<Path>,
output_path: impl AsRef<Path>,
) -> PathBufExpand description
Chooses the source file used when generating templates.
Existing config files are preferred. If the config file does not exist, an existing output template is used as the source. If neither exists, the output path is returned so generation can start from an empty template tree.
§Arguments
config_path: Preferred config source path.output_path: Output template path used as the fallback source.
§Returns
Returns the path that should be used as the root template source.
§Examples
use std::path::PathBuf;
use rust_config_tree::select_template_source;
let source = select_template_source("missing-config.yaml", "config.example.yaml");
assert_eq!(source, PathBuf::from("config.example.yaml"));