Skip to content

Commit

Permalink
refactor: move enable_ansi_support to makers.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKavik committed Mar 29, 2021
1 parent 1298672 commit 419f3c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@
//! [Apache 2](https://github.com/sagiegurari/cargo-make/blob/master/LICENSE) open source license.
//!

// Dependencies used in the binary `makers`:
#[cfg(windows)]
use ansi_term as _;

#[macro_use]
extern crate log;
#[macro_use]
Expand Down Expand Up @@ -195,9 +199,5 @@ mod version;

/// Handles the command line arguments and executes the runner.
pub fn run_cli(command_name: String, sub_command: bool) {
#[cfg(windows)]
if let Err(err) = ansi_term::enable_ansi_support() {
eprintln!("error enabling ANSI support: {:?}", err);
}
cli::run_cli(command_name, sub_command)
}
2 changes: 2 additions & 0 deletions src/makers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ fn get_name() -> String {
}

fn main() {
#[cfg(windows)]
let _ = ansi_term::enable_ansi_support();
let name = get_name();
cli::run_cli(name, false);
}

0 comments on commit 419f3c5

Please sign in to comment.