From f57af7631b7cf9119b012dad7c4ee0561c82254f Mon Sep 17 00:00:00 2001 From: Ulugbek Date: Mon, 8 Aug 2022 16:28:52 +0200 Subject: [PATCH] fix: don't terminate if the target directory already exists --- tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java index f1c51330e..785f750ba 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -437,9 +437,9 @@ public class TeaVMTool { vm.preserveType(className); } - if (!targetDirectory.mkdirs()) { + if (!targetDirectory.exists() && !targetDirectory.mkdirs()) { log.error("Target directory could not be created"); - return; + System.exit(-1); } BuildTarget buildTarget = new DirectoryBuildTarget(targetDirectory);