Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Detect term size
  • Loading branch information
ascjones committed May 17, 2023
commit 9f7a0a47105cf51d517b12fb0152199bb81b9889
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ semver = { version = "1.0.17", features = ["serde"] }
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = "1.0.96"
tempfile = "3.5.0"
term_size = "0.3.2"
url = { version = "2.3.1", features = ["serde"] }
wasm-opt = "0.112.0"
which = "4.4.0"
Expand Down
8 changes: 6 additions & 2 deletions crates/build/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ where

/// Configures the cargo command to output colour and the progress bar.
pub fn cargo_tty_output(cmd: Expression) -> Expression {
cmd.env("CARGO_TERM_COLOR", "always")
.env("CARGO_TERM_PROGRESS_WIDTH", "100")
let term_size = term_size::dimensions_stderr()
.map(|(width, _)| width.to_string())
.unwrap_or_else(|| "100".to_string());
cmd
.env("CARGO_TERM_COLOR", "always")
.env("CARGO_TERM_PROGRESS_WIDTH", term_size)
.env("CARGO_TERM_PROGRESS_WHEN", "always")
}

Expand Down