From 3b4960c3de4cf229fc3a8fbc7ee66972675354c9 Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Wed, 15 Jul 2015 08:39:45 -0500 Subject: [PATCH] Remove empty files created when compilation is unsuccessful. --- src/main/java/jace/assembly/AcmeCompiler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/jace/assembly/AcmeCompiler.java b/src/main/java/jace/assembly/AcmeCompiler.java index 44b28d4..8990541 100644 --- a/src/main/java/jace/assembly/AcmeCompiler.java +++ b/src/main/java/jace/assembly/AcmeCompiler.java @@ -93,6 +93,10 @@ public class AcmeCompiler implements CompileResult { String[] params = {"--outfile", compiledAsset.getAbsolutePath(), "-f", "cbm", "--maxerrors","16",sourceFile.getAbsolutePath()}; int status = acme.run("Acme", params); successful = status == 0; + if (!successful) { + compiledAsset.delete(); + compiledAsset = null; + } } finally { restoreSystemOutput(); System.setProperty("user.dir", oldPath);