File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
cli/src/main/java/com/devonfw/tools/ide Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ public ProcessResult run(ProcessMode processMode) {
109109 this .processBuilder .redirectOutput (Redirect .INHERIT ).redirectError (Redirect .INHERIT );
110110 }
111111
112+ if (processMode == ProcessMode .DEFAULT_SILENT ) {
113+ this .processBuilder .redirectOutput (Redirect .DISCARD ).redirectError (Redirect .DISCARD );
114+ }
115+
112116 if (this .executable == null ) {
113117 throw new IllegalStateException ("Missing executable to run process!" );
114118 }
Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ public enum ProcessMode {
3333 * parent process. This setting makes the child process dependant from the parent process! (If you close the parent
3434 * process the child process will also be terminated.)
3535 */
36- DEFAULT_CAPTURE ;
36+ DEFAULT_CAPTURE ,
37+
38+ /**
39+ * Like {@link #DEFAULT} the parent and child process will not be detached, the subprocess output will be discarded
40+ * (to the operating system "null file" ) using {@link ProcessBuilder.Redirect#DISCARD}.
41+ */
42+ DEFAULT_SILENT ;
3743
3844 /**
3945 * Method to check if the ProcessMode is a background process.
Original file line number Diff line number Diff line change 1010import com .devonfw .tools .ide .io .FileAccess ;
1111import com .devonfw .tools .ide .process .ProcessContext ;
1212import com .devonfw .tools .ide .process .ProcessErrorHandling ;
13+ import com .devonfw .tools .ide .process .ProcessMode ;
1314import com .devonfw .tools .ide .tool .LocalToolCommandlet ;
1415
1516public class DotNet extends LocalToolCommandlet {
@@ -41,9 +42,9 @@ public void run() {
4142 }
4243
4344 if (context .isQuietMode ()) {
44- runTool (null , true , args );
45+ runTool (ProcessMode . DEFAULT_SILENT , null , args );
4546 } else {
46- runTool (false , null , args );
47+ runTool (ProcessMode . DEFAULT , null , args );
4748 }
4849 }
4950
@@ -79,7 +80,7 @@ private void installDevon4NetTemplate() {
7980 ProcessContext pc = this .context .newProcess ().errorHandling (ProcessErrorHandling .WARNING ).executable (binaryPath )
8081 .addArgs (args );
8182
82- pc .run (false , false );
83+ pc .run (ProcessMode . DEFAULT );
8384
8485 }
8586
You can’t perform that action at this time.
0 commit comments