From ceecbe2f8414166dd1cc166d7a2141385cc1ee6c Mon Sep 17 00:00:00 2001 From: Werner Glanzer Date: Wed, 2 Nov 2022 15:36:56 +0100 Subject: [PATCH] fix: redirect errors, even if the error log already existed --- .../aditoweb/nbm/nodejs/impl/NodeJSExecutorImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/adito/aditoweb/nbm/nodejs/impl/NodeJSExecutorImpl.java b/src/main/java/de/adito/aditoweb/nbm/nodejs/impl/NodeJSExecutorImpl.java index f5bd76f..7972df3 100644 --- a/src/main/java/de/adito/aditoweb/nbm/nodejs/impl/NodeJSExecutorImpl.java +++ b/src/main/java/de/adito/aditoweb/nbm/nodejs/impl/NodeJSExecutorImpl.java @@ -106,9 +106,11 @@ public Process execute(@NotNull INodeJSEnvironment pEnv, @NotNull INodeJSExecBas // redirect error stream to prevent randomly blocking ui... // I dont know exactly why this fix works, but .. hey, it works File err_log = new File(Places.getUserDirectory(), "var/log/npm_err.log"); - if (!err_log.exists()) - if (err_log.createNewFile()) - builder = builder.redirectError(err_log); + + //noinspection ResultOfMethodCallIgnored + err_log.createNewFile(); + + builder = builder.redirectError(err_log); return builder.start(); }