Skip to content

Commit

Permalink
fix error message for moon info (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchen authored Nov 18, 2024
1 parent 99cb1e4 commit 6e99616
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/moon/src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,12 @@ pub fn run_info(cli: UniversalFlags, cmd: InfoSubcommand) -> anyhow::Result<i32>
bail!("cannot find mi file for package {}", name);
}

let mut mooninfo = tokio::process::Command::new("mooninfo");
mooninfo.arg("-format=text").arg(&mi);
let mut args = vec!["-format=text".into(), mi.display().to_string()];
if cmd.no_alias {
mooninfo.arg("-no-alias");
args.push("-no-alias".into());
}
let mut mooninfo = tokio::process::Command::new("mooninfo");
mooninfo.args(&args);
let out = mooninfo.output().await?;

if out.status.success() {
Expand All @@ -162,7 +163,7 @@ pub fn run_info(cli: UniversalFlags, cmd: InfoSubcommand) -> anyhow::Result<i32>
.context(format!("failed to write {}", filename))?;
} else {
eprintln!("{}", String::from_utf8_lossy(&out.stderr));
eprintln!("failed to run `mooninfo -format=text {}`", mi.display());
eprintln!("failed to run `mooninfo {}`", args.join(" "));
}

Ok(0)
Expand Down

0 comments on commit 6e99616

Please sign in to comment.