Ver código fonte

Output now creates missing folders

kindlich 5 anos atrás
pai
commit
48ccb11add
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados

+ 5
- 1
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/JavaBytecodeRunUnit.java Ver arquivo

@@ -92,7 +92,11 @@ public class JavaBytecodeRunUnit {
92 92
 			directory.mkdirs();
93 93
 
94 94
 		for (Map.Entry<String, byte[]> classEntry : classes.entrySet()) {
95
-			File output = new File(directory, classEntry.getKey() + ".class");
95
+			File output = new File(directory, classEntry.getKey().replace('.', File.separatorChar) + ".class");
96
+			if (!output.getParentFile().exists() && !output.getParentFile().mkdirs()) {
97
+				//Throw error?
98
+				continue;
99
+			}
96 100
 			try (FileOutputStream outputStream = new FileOutputStream(output)) {
97 101
 				outputStream.write(classEntry.getValue());
98 102
 			} catch (IOException ex) {

Carregando…
Cancelar
Salvar