Skip to content
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

🌈 cargo: make command output with color #481

Closed
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
4 changes: 3 additions & 1 deletion src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ pub fn cargo_install_wasm_bindgen(
.arg("--version")
.arg(version)
.arg("--root")
.arg(&tmp);
.arg(&tmp)
.arg("--color")
.arg("always");

child::run(logger, cmd, "cargo install").context("Installing wasm-bindgen with cargo")?;

Expand Down
2 changes: 2 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub fn cargo_build_wasm(
}
}
cmd.arg("--target").arg("wasm32-unknown-unknown");
cmd.arg("--color").arg("always");
child::run(log, cmd, "cargo build").context("Compiling your crate to WebAssembly failed")?;
Ok(())
}
Expand All @@ -103,6 +104,7 @@ pub fn cargo_build_wasm_tests(log: &Logger, path: &Path, debug: bool) -> Result<
cmd.arg("--release");
}
cmd.arg("--target").arg("wasm32-unknown-unknown");
cmd.arg("--color").arg("always");
child::run(log, cmd, "cargo build").context("Compilation of your program failed")?;
Ok(())
}
1 change: 1 addition & 0 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ where
cmd.arg("--release");
}
cmd.arg("--target").arg("wasm32-unknown-unknown");
cmd.arg("--color").arg("always");
child::run(log, cmd, "cargo test")
.context("Running Wasm tests with wasm-bindgen-test failed")?
};
Expand Down
2 changes: 2 additions & 0 deletions tests/all/utils/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ impl Fixture {
.arg("check")
.arg("--target")
.arg("wasm32-unknown-unknown")
.arg("--color")
.arg("always")
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
Expand Down