Skip to content

Commit b327bab

Browse files
authored
#1093: do not fail on remove of variable if not defined (#1094)
1 parent df2cda5 commit b327bab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/src/main/java/com/devonfw/tools/ide/os/WindowsHelperImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import com.devonfw.tools.ide.context.IdeContext;
66
import com.devonfw.tools.ide.log.IdeLogLevel;
7+
import com.devonfw.tools.ide.process.ProcessErrorHandling;
78
import com.devonfw.tools.ide.process.ProcessMode;
89
import com.devonfw.tools.ide.process.ProcessResult;
910

@@ -36,7 +37,8 @@ public void setUserEnvironmentValue(String key, String value) {
3637

3738
@Override
3839
public void removeUserEnvironmentValue(String key) {
39-
ProcessResult result = this.context.newProcess().executable("reg").addArgs("delete", HKCU_ENVIRONMENT, "/v", key, "/f").run(ProcessMode.DEFAULT_CAPTURE);
40+
ProcessResult result = this.context.newProcess().executable("reg").addArgs("delete", HKCU_ENVIRONMENT, "/v", key, "/f")
41+
.errorHandling(ProcessErrorHandling.LOG_WARNING).run(ProcessMode.DEFAULT_CAPTURE);
4042
if (result.isSuccessful()) {
4143
this.context.debug("Removed environment variable {}", key);
4244
} else {

0 commit comments

Comments
 (0)