From 04cf74161c686fe999892950258d351f32ec05eb Mon Sep 17 00:00:00 2001 From: Valerie Date: Wed, 16 Aug 2023 12:15:25 -0400 Subject: [PATCH] started colorizing outputs --- src/operation.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/operation.rs b/src/operation.rs index 49dfc13..c8369fa 100644 --- a/src/operation.rs +++ b/src/operation.rs @@ -6,12 +6,16 @@ use std::{ path::Path }; -use toml::{ map::Map, Value }; use tera::{ Context, Tera }; +use termion::{ + color::{ self, Fg }, + style +}; +use toml::{ map::Map, Value }; pub fn apply(targets: &Vec>) { let home = var("HOME").unwrap(); - println!("running apply:"); + println!("{}running apply{}", style::Bold, style::Reset); for target in targets { // get path and name let path = target.get("path"); @@ -48,13 +52,13 @@ pub fn apply(targets: &Vec>) { pub fn build(targets: &Vec>, tera: &mut Tera, context: &Context) { let home = var("HOME").unwrap(); - println!("running build:"); + println!("{}running build{}", style::Bold, style::Reset); for target in targets { // get name property let i_name = target.get("name"); // handle empty names gracefully if i_name.is_none() { - println!(" target missing name; skipping"); + println!(" {}target missing name; skipping{}", Fg(color::Yellow), Fg(color::Reset)); continue; }