Skip to content

Commit b2601f7

Browse files
committed
Merge branch 'pr-120-amend'
2 parents 9cb6bce + 39099f0 commit b2601f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/main/java/com/badlogicgames/packr/Packr.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ private void cleanOrCreateOutputFolder(PackrOutput output) throws IOException {
6565
if (folder.exists()) {
6666
System.out.println("Cleaning output directory '" + folder.getAbsolutePath() + "' ...");
6767
PackrFileUtils.deleteDirectory(folder);
68-
} else {
69-
PackrFileUtils.mkdirs(folder);
7068
}
69+
PackrFileUtils.mkdirs(folder);
7170
}
7271

7372
private PackrOutput buildMacBundle(PackrOutput output) throws IOException {
@@ -237,6 +236,9 @@ private void copyAndMinimizeJRE(PackrOutput output, PackrConfig config) throws I
237236
// unpack JDK zip (or copy if it's a folder)
238237
System.out.println("Unpacking JRE ...");
239238
File tmp = new File(jreStoragePath, "tmp");
239+
if (tmp.exists()) {
240+
PackrFileUtils.deleteDirectory(tmp);
241+
}
240242
PackrFileUtils.mkdirs(tmp);
241243

242244
if (jdkFile.isDirectory()) {

src/main/java/com/badlogicgames/packr/PackrFileUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ static void delete(File path) throws IOException {
4848

4949
/**
5050
* Copies directories, preserving file attributes.
51-
*
51+
* <p>
5252
* The {@link org.zeroturnaround.zip.commons.FileUtilsV2_2#copyDirectory(File, File)} function does not
5353
* preserve file attributes.
5454
*/
5555
static void copyDirectory(File sourceDirectory, File targetDirectory) throws IOException {
5656

57-
final Path sourcePath = Paths.get(sourceDirectory.toURI());
57+
final Path sourcePath = Paths.get(sourceDirectory.toURI()).toRealPath();
5858
final Path targetPath = Paths.get(targetDirectory.toURI());
5959

6060
Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {

0 commit comments

Comments
 (0)