-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d01ba56
commit 9f4ba06
Showing
23 changed files
with
1,192 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Common xtask command helpers | ||
|
||
use anyhow::{bail, Context, Result}; | ||
use std::process::Command; | ||
|
||
/// Runs the given command, printing some basic debug information around it, and | ||
/// failing with an error message if the command does not exit successfully | ||
pub fn run_subcmd(mut command: Command) -> Result<()> { | ||
eprintln!( | ||
"running: {} {}", | ||
command.get_program().to_str().unwrap(), | ||
command | ||
.get_args() | ||
.map(|arg| format!("{:?}", arg.to_str().unwrap())) | ||
.collect::<Vec<_>>() | ||
.join(" ") | ||
); | ||
|
||
let exit_status = command | ||
.spawn() | ||
.context("failed to spawn child process")? | ||
.wait() | ||
.context("failed to wait for child process")?; | ||
|
||
if !exit_status.success() { | ||
bail!("failed: {}", exit_status); | ||
} | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.