Skip to content

Commit 3763fdf

Browse files
Merge pull request #49 from ashleygwilliams/pretty-output
fix(style): improve output messaging
2 parents 96acdb8 + ac9f5f7 commit 3763fdf

File tree

8 files changed

+224
-38
lines changed

8 files changed

+224
-38
lines changed

Cargo.lock

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ license = "MIT/Apache-2.0"
88
readme = "README.md"
99

1010
[dependencies]
11+
console = "0.6.1"
1112
failure = "0.1.1"
13+
indicatif = "0.9.0"
1214
quicli = "0.2"
1315
serde = "1.0"
1416
serde_derive = "1.0"

src/bindgen.rs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,14 @@ pub fn cargo_install_wasm_bindgen() {
88
.output()
99
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));
1010

11-
if output.status.success() {
12-
let s = String::from_utf8_lossy(&output.stdout);
13-
14-
println!(
15-
"✅ cargo_install_wasm_bindgen succeeded and stdout was:\n{}",
16-
s
17-
);
18-
} else {
19-
let s = String::from_utf8_lossy(&output.stderr);
20-
21-
print!(
22-
"⛔ cargo_install_wasm_bindgen failed and stderr was:\n{}",
23-
s
24-
);
25-
}
11+
//if !output.status.success() {
12+
// let s = String::from_utf8_lossy(&output.stderr);
13+
14+
// print!(
15+
// "⛔ cargo_install_wasm_bindgen failed and stderr was:\n{}",
16+
// s
17+
// );
18+
// }
2619
}
2720

2821
pub fn wasm_bindgen_build(path: &str, name: &str) {
@@ -36,12 +29,7 @@ pub fn wasm_bindgen_build(path: &str, name: &str) {
3629
.output()
3730
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));
3831

39-
if output.status.success() {
40-
let s = String::from_utf8_lossy(&output.stdout);
41-
42-
println!("✅ wasm_bindgen_build succeeded and stdout was:\n{}", s);
43-
println!("🏄<200d>♀️ ready to go!");
44-
} else {
32+
if !output.status.success() {
4533
let s = String::from_utf8_lossy(&output.stderr);
4634

4735
print!("⛔ wasm_bindgen_build failed and stderr was:\n{}", s);

src/build.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@ pub fn rustup_add_wasm_target() {
88
.output()
99
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));
1010

11-
if output.status.success() {
12-
let s = String::from_utf8_lossy(&output.stdout);
13-
14-
println!(
15-
"✅ rustup_add_wasm_target succeeded and stdout was:\n{}",
16-
s
17-
);
18-
} else {
11+
if !output.status.success() {
1912
let s = String::from_utf8_lossy(&output.stderr);
2013

2114
print!("⛔ rustup_add_wasm_target failed and stderr was:\n{}", s);
@@ -32,12 +25,7 @@ pub fn cargo_build_wasm(path: &str) {
3225
.output()
3326
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));
3427

35-
if output.status.success() {
36-
let s = String::from_utf8_lossy(&output.stdout);
37-
38-
println!("✅ cargo_build_wasm succeeded and stdout was:\n{}", s);
39-
println!("🏎️ 💨 compiled to wasm!");
40-
} else {
28+
if !output.status.success() {
4129
let s = String::from_utf8_lossy(&output.stderr);
4230

4331
print!("⛔ cargo_build_wasm failed and stderr was:\n{}", s);

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
extern crate failure;
2+
extern crate indicatif;
23
#[macro_use]
34
extern crate serde_derive;
45
extern crate serde_json;

0 commit comments

Comments
 (0)