Addd flag to list used template variables

This commit is contained in:
2021-05-27 23:34:46 +02:00
parent 8d9937e44e
commit ce84eac3c3
4 changed files with 121 additions and 21 deletions

View File

@ -3,21 +3,13 @@ use crate::Config;
use async_recursion::async_recursion;
use blueprint::{parse_template, Env, Value};
use futures::future::join_all;
use serde::Serialize;
use std::ffi::OsStr;
use std::io::ErrorKind;
use std::path::PathBuf;
use tokio::fs::{copy, create_dir, read_dir, read_to_string, write};
use tokio::join;
#[derive(Serialize)]
struct TemplateContext<'a> {
hostname: &'a str,
lightmode: bool,
darkmode: bool,
}
const TEMPLATE_EXTENSION: &str = "tpl";
pub const TEMPLATE_EXTENSION: &str = "tpl";
pub async fn build_tree(cfg: &Config) -> Result<(), Errors> {
let hostname_path: PathBuf = "/etc/hostname".into();