Skip to content

fix(style): improve output messaging #49

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

Merged
merged 1 commit into from
Mar 13, 2018
Merged
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
116 changes: 116 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ license = "MIT/Apache-2.0"
readme = "README.md"

[dependencies]
console = "0.6.1"
failure = "0.1.1"
indicatif = "0.9.0"
quicli = "0.2"
serde = "1.0"
serde_derive = "1.0"
Expand Down
30 changes: 9 additions & 21 deletions src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@ pub fn cargo_install_wasm_bindgen() {
.output()
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));

if output.status.success() {
let s = String::from_utf8_lossy(&output.stdout);

println!(
"✅ cargo_install_wasm_bindgen succeeded and stdout was:\n{}",
s
);
} else {
let s = String::from_utf8_lossy(&output.stderr);

print!(
"⛔ cargo_install_wasm_bindgen failed and stderr was:\n{}",
s
);
}
//if !output.status.success() {
// let s = String::from_utf8_lossy(&output.stderr);

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

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

if output.status.success() {
let s = String::from_utf8_lossy(&output.stdout);

println!("✅ wasm_bindgen_build succeeded and stdout was:\n{}", s);
println!("🏄<200d>♀️ ready to go!");
} else {
if !output.status.success() {
let s = String::from_utf8_lossy(&output.stderr);

print!("⛔ wasm_bindgen_build failed and stderr was:\n{}", s);
Expand Down
16 changes: 2 additions & 14 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ pub fn rustup_add_wasm_target() {
.output()
.unwrap_or_else(|e| panic!("failed to execute process: {}", e));

if output.status.success() {
let s = String::from_utf8_lossy(&output.stdout);

println!(
"✅ rustup_add_wasm_target succeeded and stdout was:\n{}",
s
);
} else {
if !output.status.success() {
let s = String::from_utf8_lossy(&output.stderr);

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

if output.status.success() {
let s = String::from_utf8_lossy(&output.stdout);

println!("✅ cargo_build_wasm succeeded and stdout was:\n{}", s);
println!("🏎️ 💨 compiled to wasm!");
} else {
if !output.status.success() {
let s = String::from_utf8_lossy(&output.stderr);

print!("⛔ cargo_build_wasm failed and stderr was:\n{}", s);
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate failure;
extern crate indicatif;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
Expand Down
Loading