Skip to content

Commit

Permalink
fix: Don't use spinner when building wasm on CI (#5208)
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Murzin <[email protected]>
  • Loading branch information
dima74 authored Oct 30, 2024
1 parent 5a87ecf commit 15778b2
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions crates/iroha_wasm_builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,28 @@ fn main() -> color_eyre::Result<()> {
};

let output = if optimize {
let mut sp = spinoff::Spinner::new_with_stream(
spinoff::spinners::Binary,
"Optimizing the output",
None,
spinoff::Streams::Stderr,
);
let sp = if std::env::var("CI").is_err() {
Some(spinoff::Spinner::new_with_stream(
spinoff::spinners::Binary,
"Optimizing the output",
None,
spinoff::Streams::Stderr,
))
} else {
None
};

match output.optimize() {
Ok(optimized) => {
sp.success("Output is optimized");
if let Some(mut sp) = sp {
sp.success("Output is optimized");
}
optimized
}
err => {
sp.fail("Optimization failed");
if let Some(mut sp) = sp {
sp.fail("Optimization failed");
}
err?
}
}
Expand Down

0 comments on commit 15778b2

Please sign in to comment.