Skip to content

Commit 1c50b12

Browse files
Merge pull request #181 from ashleygwilliams/migerh-fix-spinners
Let the spinners spin again
2 parents 1b0120e + e30ed47 commit 1c50b12

File tree

14 files changed

+614
-571
lines changed

14 files changed

+614
-571
lines changed

src/bindgen.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ use PBAR;
66

77
pub fn cargo_install_wasm_bindgen(step: &Step) -> Result<(), Error> {
88
let msg = format!("{}Installing WASM-bindgen...", emoji::DOWN_ARROW);
9-
let pb = PBAR.step(step, &msg);
9+
PBAR.step(step, &msg)?;
1010
let output = Command::new("cargo")
1111
.arg("install")
1212
.arg("wasm-bindgen-cli")
1313
.arg("--force")
1414
.output()?;
15-
pb.finish();
1615
if !output.status.success() {
1716
let s = String::from_utf8_lossy(&output.stderr);
1817
if s.contains("already exists") {
19-
PBAR.info("wasm-bindgen already installed");
18+
PBAR.info("wasm-bindgen already installed")?;
2019
return Ok(());
2120
}
2221
Error::cli("Installing wasm-bindgen failed", s)
@@ -34,7 +33,7 @@ pub fn wasm_bindgen_build(
3433
step: &Step,
3534
) -> Result<(), Error> {
3635
let msg = format!("{}Running WASM-bindgen...", emoji::RUNNER);
37-
let pb = PBAR.step(step, &msg);
36+
PBAR.step(step, &msg)?;
3837
let binary_name = name.replace("-", "_");
3938
let release_or_debug = if debug { "debug" } else { "release" };
4039
let wasm_path = format!(
@@ -60,7 +59,6 @@ pub fn wasm_bindgen_build(
6059
.arg(dts_arg)
6160
.arg(target_arg)
6261
.output()?;
63-
pb.finish();
6462
if !output.status.success() {
6563
let s = String::from_utf8_lossy(&output.stderr);
6664
Error::cli("wasm-bindgen failed to execute properly", s)

src/build.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use PBAR;
66

77
pub fn rustup_add_wasm_target(step: &Step) -> Result<(), Error> {
88
let msg = format!("{}Adding WASM target...", emoji::TARGET);
9-
let pb = PBAR.step(step, &msg);
9+
PBAR.step(step, &msg)?;
1010
ensure_nightly()?;
1111
let output = Command::new("rustup")
1212
.arg("target")
@@ -15,7 +15,6 @@ pub fn rustup_add_wasm_target(step: &Step) -> Result<(), Error> {
1515
.arg("--toolchain")
1616
.arg("nightly")
1717
.output()?;
18-
pb.finish();
1918
if !output.status.success() {
2019
let s = String::from_utf8_lossy(&output.stderr);
2120
Error::cli("Adding the wasm32-unknown-unknown target failed", s)
@@ -42,7 +41,7 @@ fn ensure_nightly() -> Result<(), Error> {
4241

4342
pub fn cargo_build_wasm(path: &str, debug: bool, step: &Step) -> Result<(), Error> {
4443
let msg = format!("{}Compiling to WASM...", emoji::CYCLONE);
45-
let pb = PBAR.step(step, &msg);
44+
PBAR.step(step, &msg)?;
4645
let output = {
4746
let mut cmd = Command::new("cargo");
4847
cmd.current_dir(path).arg("+nightly").arg("build");
@@ -52,7 +51,7 @@ pub fn cargo_build_wasm(path: &str, debug: bool, step: &Step) -> Result<(), Erro
5251
cmd.arg("--target").arg("wasm32-unknown-unknown");
5352
cmd.output()?
5453
};
55-
pb.finish();
54+
5655
if !output.status.success() {
5756
let s = String::from_utf8_lossy(&output.stderr);
5857
Error::cli("Compilation of your program failed", s)

0 commit comments

Comments
 (0)