Create output directory if it does not exist.

FileOutputStreams will not automatically create the necessary directories, so we have to do it.
This commit is contained in:
LexManos 2018-09-30 01:01:14 -07:00 committed by md-5
parent a5ebbbfa37
commit e78721546a

View File

@ -172,6 +172,9 @@ public class JarRemapper extends CustomRemapper {
if (jar == null) { if (jar == null) {
return; return;
} }
if (!target.getParentFile().exists()) {
target.getParentFile().mkdirs();
}
ClassRepo repo = new JarRepo(jar); ClassRepo repo = new JarRepo(jar);
try (JarOutputStream out = new JarOutputStream(new FileOutputStream(target))) { try (JarOutputStream out = new JarOutputStream(new FileOutputStream(target))) {
Set<String> jarEntries = jar.getEntryNames(); Set<String> jarEntries = jar.getEntryNames();