Merge pull request #126 from esp-rs/fix/logs

Fix logs
This commit is contained in:
Sergio Gasquez Arcos 2023-01-03 11:06:43 +01:00 committed by GitHub
commit 061f0a16b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 12 deletions

View File

@ -2,7 +2,7 @@ use console::Emoji;
pub static ERROR: Emoji<'_, '_> = Emoji("", "");
pub static CHECK: Emoji<'_, '_> = Emoji("", "");
pub static WARN: Emoji<'_, '_> = Emoji("⚠️ ", "");
pub static WARN: Emoji<'_, '_> = Emoji("⚠️ ", "");
pub static WRENCH: Emoji<'_, '_> = Emoji("🔧 ", "");
pub static DOWNLOAD: Emoji<'_, '_> = Emoji("📥 ", "");
pub static INFO: Emoji<'_, '_> = Emoji("💡 ", "");

View File

@ -237,7 +237,10 @@ impl Crate {
}
pub fn uninstall(extra_crate: &str) -> Result<(), Error> {
cmd!("cargo", "uninstall", extra_crate).run()?;
cmd!("cargo", "uninstall", extra_crate, "--quiet")
.into_inner()
.stdout(Stdio::null())
.spawn()?;
Ok(())
}
}
@ -255,7 +258,10 @@ impl Installable for Crate {
if PathBuf::from(crate_path).exists() {
warn!("{} {} is already installed", emoji::WARN, self.name);
} else {
cmd!("cargo", "install", &self.name).run()?;
cmd!("cargo", "install", &self.name, "--quiet")
.into_inner()
.stdout(Stdio::null())
.spawn()?;
}
Ok(vec![]) // No exports
@ -287,7 +293,9 @@ impl RiscVTarget {
"riscv32imc-unknown-none-elf",
"riscv32imac-unknown-none-elf"
)
.run()?;
.into_inner()
.stdout(Stdio::null())
.spawn()?;
Ok(())
}
}
@ -422,9 +430,12 @@ async fn install_rustup(nightly_version: &str, host_triple: &HostTriple) -> Resu
host_triple.to_string(),
"--profile",
"minimal",
"-y"
"-y",
"--quiet"
)
.run()?;
.into_inner()
.stdout(Stdio::null())
.spawn()?;
#[cfg(not(windows))]
cmd!(
"/bin/bash",
@ -435,9 +446,12 @@ async fn install_rustup(nightly_version: &str, host_triple: &HostTriple) -> Resu
host_triple.to_string(),
"--profile",
"minimal",
"-y"
"-y",
"--quiet"
)
.run()?;
.into_inner()
.stdout(Stdio::null())
.spawn()?;
#[cfg(windows)]
let path = format!(
@ -462,7 +476,7 @@ async fn install_rustup(nightly_version: &str, host_triple: &HostTriple) -> Resu
}
/// Installs the desired version of the nightly toolchain.
fn install_rust_nightly(version: &str) -> Result<()> {
fn install_rust_nightly(version: &str) -> Result<(), Error> {
info!("{} Installing {} toolchain", emoji::WRENCH, version);
cmd!(
"rustup",
@ -470,10 +484,12 @@ fn install_rust_nightly(version: &str) -> Result<()> {
"install",
version,
"--profile",
"minimal"
"minimal",
"--quiet"
)
.run()
.into_diagnostic()?;
.into_inner()
.stdout(Stdio::null())
.spawn()?;
Ok(())
}