Skip to content

Colorize output from cargo on non-Windows OSes #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ pub fn cargo_install_wasm_bindgen(
.context("failed to create temp dir for `cargo install wasm-bindgen`")?;

let mut cmd = Command::new("cargo");
if cfg!(not(windows)) {
cmd.arg("--color").arg("always");
}
cmd.arg("install")
.arg("--force")
.arg("wasm-bindgen-cli")
Expand Down
6 changes: 6 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ pub fn cargo_build_wasm(
let msg = format!("{}Compiling to WASM...", emoji::CYCLONE);
PBAR.step(step, &msg);
let mut cmd = Command::new("cargo");
if cfg!(not(windows)) {
cmd.arg("--color").arg("always");
}
cmd.current_dir(path).arg("build").arg("--lib");
match profile {
BuildProfile::Profiling => {
Expand Down Expand Up @@ -97,6 +100,9 @@ pub fn cargo_build_wasm(
/// Run `cargo build --tests` targetting `wasm32-unknown-unknown`.
pub fn cargo_build_wasm_tests(path: &Path, debug: bool) -> Result<(), Error> {
let mut cmd = Command::new("cargo");
if cfg!(not(windows)) {
cmd.arg("--color").arg("always");
}
cmd.current_dir(path).arg("build").arg("--tests");
if !debug {
cmd.arg("--release");
Expand Down