mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-04 02:04:30 +00:00
show warning when parallel export and single file export are both enabled
This commit is contained in:
@@ -275,7 +275,9 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
}
|
||||
}
|
||||
|
||||
Path.createDirectorySafe(file.getParentFile());
|
||||
if (file != null) {
|
||||
Path.createDirectorySafe(file.getParentFile());
|
||||
}
|
||||
|
||||
try (FileTextWriter writer = exportSettings.singleFile ? null : new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) {
|
||||
FileTextWriter writer2 = exportSettings.singleFile ? exportSettings.singleFileWriter : writer;
|
||||
|
||||
@@ -376,22 +376,26 @@ public class AS3ScriptExporter {
|
||||
}
|
||||
}
|
||||
|
||||
File file = item.getExportFile(outdir, exportSettings);
|
||||
String filePath = file.getPath();
|
||||
if (files.contains(filePath.toLowerCase())) {
|
||||
String parentPath = file.getParent();
|
||||
String fileName = file.getName();
|
||||
String extension = Path.getExtension(fileName);
|
||||
String fileNameWithoutExtension = Path.getFileNameWithoutExtension(file);
|
||||
int i = 2;
|
||||
do {
|
||||
filePath = Path.combine(parentPath, fileNameWithoutExtension + "_" + i++ + extension);
|
||||
} while (files.contains(filePath.toLowerCase()));
|
||||
File file = null;
|
||||
if (!exportSettings.singleFile) {
|
||||
file = item.getExportFile(outdir, exportSettings);
|
||||
String filePath = file.getPath();
|
||||
if (files.contains(filePath.toLowerCase())) {
|
||||
String parentPath = file.getParent();
|
||||
String fileName = file.getName();
|
||||
String extension = Path.getExtension(fileName);
|
||||
String fileNameWithoutExtension = Path.getFileNameWithoutExtension(file);
|
||||
int i = 2;
|
||||
do {
|
||||
filePath = Path.combine(parentPath, fileNameWithoutExtension + "_" + i++ + extension);
|
||||
} while (files.contains(filePath.toLowerCase()));
|
||||
|
||||
file = new File(filePath);
|
||||
file = new File(filePath);
|
||||
}
|
||||
|
||||
files.add(filePath.toLowerCase());
|
||||
}
|
||||
|
||||
files.add(filePath.toLowerCase());
|
||||
tasks.add(new ExportPackTask(handler, cnt++, packs.size(), item.getClassPath(), item, file, exportSettings, parallel, evl));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user