diff --git a/manager/Cargo.lock b/manager/Cargo.lock index a13b7a3..16da2cc 100644 --- a/manager/Cargo.lock +++ b/manager/Cargo.lock @@ -74,11 +74,12 @@ dependencies = [ [[package]] name = "blueprint" -version = "0.2.0" -source = "git+https://git.nubo.sh/hulthe/blueprint.git#2d0875188e3d378a825d24348de4d92a228bf420" +version = "0.3.0" +source = "git+https://git.nubo.sh/hulthe/blueprint.git#0af5d72005bebca426eeff628c1f010d2e850f06" dependencies = [ "nom", "structopt", + "thiserror", ] [[package]] diff --git a/manager/src/builder.rs b/manager/src/builder.rs index f21c009..d78162e 100644 --- a/manager/src/builder.rs +++ b/manager/src/builder.rs @@ -1,7 +1,7 @@ -use crate::error::{Error, ErrorLocation, Errors, InnerError}; +use crate::error::{Error, ErrorLocation, Errors}; use crate::Config; use async_recursion::async_recursion; -use blueprint::{parse_file, Env, Value}; +use blueprint::{parse_template, Env, Value}; use futures::future::join_all; use serde::Serialize; use std::ffi::OsStr; @@ -105,8 +105,7 @@ async fn file(cfg: &Config, env: &Env, relative: PathBuf) -> Result<(), Error> { .with_location(&template_path)?; let mut rendered = Vec::::new(); - parse_file(&file_str) - .map_err(|_| InnerError::TemplateParseErr) + parse_template(&file_str) .with_location(&template_path)? .write(&env, &mut rendered) .with_location(&template_path)?; diff --git a/manager/src/error.rs b/manager/src/error.rs index 258053e..1a1e2bc 100644 --- a/manager/src/error.rs +++ b/manager/src/error.rs @@ -18,7 +18,7 @@ pub enum InnerError { IoErr(#[from] io::Error), #[error("Failed to parse template file")] - TemplateParseErr, + TemplateErr(#[from] blueprint::Error), } impl From> for Errors { diff --git a/tree/.config/alacritty/alacritty.yml.tpl b/tree/.config/alacritty/alacritty.yml.tpl index eaeb35d..0cb98b9 100644 --- a/tree/.config/alacritty/alacritty.yml.tpl +++ b/tree/.config/alacritty/alacritty.yml.tpl @@ -123,9 +123,7 @@ colors: magenta: '0x8f3f71' cyan: '0x427b58' white: '0x3c3836' -{% end %} - -{% if dark %} +{% else %} # Colors (Gruvbox dark) colors: # Default colors diff --git a/tree/.config/starship.toml b/tree/.config/starship.toml.tpl similarity index 52% rename from tree/.config/starship.toml rename to tree/.config/starship.toml.tpl index a119e28..d65c9f3 100644 --- a/tree/.config/starship.toml +++ b/tree/.config/starship.toml.tpl @@ -6,11 +6,18 @@ vicmd_symbol = "[⤶](bold green)" [username] show_always = true +{% if demo %} +format = "[demo]($style) in " +{% else %} format = "[$user]($style)@" +{% end %} [hostname] ssh_only = false format = "[$hostname]($style) in " +{% if demo %} +disabled = true +{% end %} [custom.stl] description = "time logger" @@ -19,3 +26,34 @@ command = "cat /home/hulthe/.stld" symbol = "🕑" style = "italic bright-purple" format = "[$symbol ($output )]($style)" +{% if demo %} +disabled = true +{% end %} + + +# hide all persondata while in demo mode +{% if demo %} +[directory] +truncation_length = 1 + +[git_branch] +disabled = true + +[git_commit] +disabled = true + +[git_state] +disabled = true + +[git_status] +disabled = true + +[package] +disabled = true + +[rust] +disabled = true + +[python] +disabled = true +{% end %}