use std::path::Path;
use crate::constants::paths::{
SCAN_OVERRIDE_PATH, TASK_BUILDER_OVERRIDE_PATH, WORKER_OVERRIDE_PATH,
};
pub(super) fn worker_template_source(repo_root: &Path) -> &'static str {
template_source(repo_root, WORKER_OVERRIDE_PATH)
}
pub(super) fn scan_template_source(repo_root: &Path) -> &'static str {
template_source(repo_root, SCAN_OVERRIDE_PATH)
}
pub(super) fn task_builder_template_source(repo_root: &Path) -> &'static str {
template_source(repo_root, TASK_BUILDER_OVERRIDE_PATH)
}
fn template_source(repo_root: &Path, current: &'static str) -> &'static str {
if repo_root.join(current).exists() {
current
} else {
"(embedded default)"
}
}