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) {
109
109
this .processBuilder .redirectOutput (Redirect .INHERIT ).redirectError (Redirect .INHERIT );
110
110
}
111
111
112
+ if (processMode == ProcessMode .DEFAULT_SILENT ) {
113
+ this .processBuilder .redirectOutput (Redirect .DISCARD ).redirectError (Redirect .DISCARD );
114
+ }
115
+
112
116
if (this .executable == null ) {
113
117
throw new IllegalStateException ("Missing executable to run process!" );
114
118
}
Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ public enum ProcessMode {
33
33
* parent process. This setting makes the child process dependant from the parent process! (If you close the parent
34
34
* process the child process will also be terminated.)
35
35
*/
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 ;
37
43
38
44
/**
39
45
* Method to check if the ProcessMode is a background process.
Original file line number Diff line number Diff line change 10
10
import com .devonfw .tools .ide .io .FileAccess ;
11
11
import com .devonfw .tools .ide .process .ProcessContext ;
12
12
import com .devonfw .tools .ide .process .ProcessErrorHandling ;
13
+ import com .devonfw .tools .ide .process .ProcessMode ;
13
14
import com .devonfw .tools .ide .tool .LocalToolCommandlet ;
14
15
15
16
public class DotNet extends LocalToolCommandlet {
@@ -41,9 +42,9 @@ public void run() {
41
42
}
42
43
43
44
if (context .isQuietMode ()) {
44
- runTool (null , true , args );
45
+ runTool (ProcessMode . DEFAULT_SILENT , null , args );
45
46
} else {
46
- runTool (false , null , args );
47
+ runTool (ProcessMode . DEFAULT , null , args );
47
48
}
48
49
}
49
50
@@ -79,7 +80,7 @@ private void installDevon4NetTemplate() {
79
80
ProcessContext pc = this .context .newProcess ().errorHandling (ProcessErrorHandling .WARNING ).executable (binaryPath )
80
81
.addArgs (args );
81
82
82
- pc .run (false , false );
83
+ pc .run (ProcessMode . DEFAULT );
83
84
84
85
}
85
86
You can’t perform that action at this time.
0 commit comments