Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Merge pull request #89 from tomassedovic/better-tcod-sys-output
Browse files Browse the repository at this point in the history
Print better output info on tcod-sys failure
  • Loading branch information
tomassedovic committed Jan 26, 2015
2 parents 8caf08e + c377cb8 commit 53b1d29
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tcod-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(unstable)]

use std::io::{fs, Command};
use std::io::process::InheritFd;
use std::os;


Expand All @@ -29,11 +28,18 @@ fn main() {
.arg("clean")
.arg("all")
.cwd(&libtcod_dir);
assert!(make.stdout(InheritFd(1))
.stdout(InheritFd(2))
.status()
.unwrap()
.success());
match make.output() {
Ok(output) => {
if output.status.success() {
println!("`make` succeeded.");
} else {
println!("STDOUT: {}", String::from_utf8_lossy(&output.output[]));
println!("STDERR: {}", String::from_utf8_lossy(&output.error[]));
panic!("`make` returned: {}", output.status);
}
}
Err(e) => panic!("`make` failed: {}", e),
}

// TODO(shadower): there's a bunch of name special-casing I came across
// testing this in my linux and windows setups. I have no idea why these are
Expand Down

0 comments on commit 53b1d29

Please sign in to comment.