message: Make error code copy_pasteable
diff: @@ -22,34 +22,18 @@ pub use subdomain::get_subdomain;
  pub use subdomain::set_subdomain;
  pub use whoami::whoami;
  -use std::str;
  -
  -const UNKNOWN_ERR: &str =
  - "An unexpected error occurred, try running the command again with RUSTLOG=info";
  -
  /// Run the given command and return its stdout.
  pub fn run(mut command: Command, command_name: &str) -> Result<(), failure::Error> {
  log::info!("Running {:?}", command);
  - let output = command.output()?;
  - dbg!(output.clone());
  + let status = command.status()?;
  - println!(
  - "{}",
  - String::from_utf8(output.stdout).expect(UNKNOWN_ERR).trim()
  - );
  -
  - if !output.status.success() {
  - log::info!(
  - "failed to execute `{}`: exited with {}",
  - command_name,
  - output.status
  - );
  - let mut serr = String::from_utf8(output.stderr).expect(UNKNOWN_ERR);
  - if serr.starts_with("Error: ") {
  - serr = serr.get(7..).unwrap_or(UNKNOWN_ERR).to_string();
  - }
  - failure::bail!("{}", serr.trim())
  + if !status.success() {
  + failure::bail!(
  + "failed to execute `{}`\nexited with {}",
  + command_name.replace("\"", ""),
  + status
  + )
  }
  Ok(())
  }
  