colored command logs on compilation

This commit is contained in:
JOLIMAITRE Matthieu 2023-01-04 19:38:48 +01:00
parent 058ea6a2f0
commit 96e984244b
3 changed files with 9 additions and 2 deletions

2
Cargo.lock generated
View file

@ -138,7 +138,7 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
[[package]] [[package]]
name = "epitls-pi" name = "epitls-pi"
version = "1.5.0" version = "1.5.1"
dependencies = [ dependencies = [
"chrono", "chrono",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "epitls-pi" name = "epitls-pi"
version = "1.5.0" version = "1.5.1"
edition = "2021" edition = "2021"
license = "GPL-3.0+" license = "GPL-3.0+"
description = "A little helper tool meant to ease the developpment of the C piscine at EPITA/Toulouse." description = "A little helper tool meant to ease the developpment of the C piscine at EPITA/Toulouse."

View file

@ -4,6 +4,8 @@ use std::{
process::{exit, Command, ExitStatus, Stdio}, process::{exit, Command, ExitStatus, Stdio},
}; };
use termion::color;
use crate::utils::{ use crate::utils::{
log_command_run, log_failure, log_separator_bottom, log_separator_top, remove_dupes, log_command_run, log_failure, log_separator_bottom, log_separator_top, remove_dupes,
tmp_file_path, Apply, tmp_file_path, Apply,
@ -72,6 +74,11 @@ impl CompileTask {
log_command_run(&command); log_command_run(&command);
log_separator_top(); log_separator_top();
} }
println!(
"{}{command:?}{}",
color::Fg(color::AnsiValue(8)),
color::Fg(color::Reset)
);
let status = command.status().unwrap(); let status = command.status().unwrap();
if self.verbose { if self.verbose {
log_separator_bottom(); log_separator_bottom();