Skip to content

Commit 3160dca

Browse files
committed
hide mvn --version output
1 parent 51b52d5 commit 3160dca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tmc-langs-java/src/maven.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::ffi::OsString;
1111
use std::fs::{self, File};
1212
use std::io::{Cursor, Write};
1313
use std::path::{Path, PathBuf};
14-
use std::process::Command;
14+
use std::process::{Command, Stdio};
1515
use std::time::Duration;
1616
use tar::Archive;
1717
use tmc_langs_framework::{
@@ -39,7 +39,12 @@ impl MavenPlugin {
3939
// finally, return the path to the extracted executable
4040
fn get_mvn_command(&self) -> Result<OsString, JavaError> {
4141
// check if mvn is in PATH
42-
if let Ok(status) = Command::new("mvn").arg("--version").status() {
42+
if let Ok(status) = Command::new("mvn")
43+
.arg("--version")
44+
.stdout(Stdio::piped())
45+
.stderr(Stdio::piped())
46+
.status()
47+
{
4348
if status.success() {
4449
return Ok(OsString::from("mvn"));
4550
}

0 commit comments

Comments
 (0)