From fc3c45e056ca58880749f99d0a75e9dde8ad1998 Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 13 Apr 2021 19:16:04 +0300 Subject: [PATCH] try ansi_color package for Windows builds --- Cargo.lock | 1 + Cargo.toml | 4 ++++ leo/main.rs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d4b0d14559..9f8a183bb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1347,6 +1347,7 @@ dependencies = [ name = "leo-lang" version = "1.3.0" dependencies = [ + "ansi_term 0.12.1", "anyhow", "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index 2a16b49cdf..2099e80a87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,6 +150,10 @@ features = [ "fmt" ] [dependencies.zip] version = "0.5" +# add ansi support for Windows builds +[target.'cfg(windows)'.dependencies.ansi_term] +version = "0.12.1" + [dev-dependencies.rusty-hook] version = "0.11.2" diff --git a/leo/main.rs b/leo/main.rs index a0784f70fe..604f589782 100644 --- a/leo/main.rs +++ b/leo/main.rs @@ -178,6 +178,9 @@ enum CommandOpts { } fn main() { + #[cfg(target_family = "windows")] + ansi_term::enable_ansi_support(); + // Read command line arguments. let opt = Opt::from_args();