Skip to content

Commit 365c96d

Browse files
committed
U fix error compressing disk image due to target dmg file exists (add -ov arg)
1 parent 2e9b32f commit 365c96d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateDmg.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public File apply(Packager packager) throws Exception {
8383
Logger.info("Creating image: " + tempDmgFile.getAbsolutePath());
8484
execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", "HFS+", "-format", "UDRW", tempDmgFile);
8585

86-
Logger.info("Unmounting disk image ...");
8786
if (mountFolder.exists()) {
87+
Logger.info("Unmounting volume: " + mountFolder);
8888
execute("hdiutil", "detach", mountFolder);
8989
}
9090

@@ -125,12 +125,12 @@ public File apply(Packager packager) throws Exception {
125125
execute("SetFile", "-a", "C", mountFolder);
126126

127127
// unmounts
128-
Logger.info("Unmounting disk image...");
128+
Logger.info("Unmounting volume: " + mountFolder);
129129
execute("hdiutil", "detach", mountFolder);
130130

131131
// compress image
132132
Logger.info("Compressing disk image...");
133-
execute("hdiutil", "convert", tempDmgFile, "-format", "UDZO", "-imagekey", "zlib-level=9", "-o", dmgFile);
133+
execute("hdiutil", "convert", tempDmgFile, "-ov", "-format", "UDZO", "-imagekey", "zlib-level=9", "-o", dmgFile);
134134
tempDmgFile.delete();
135135

136136
// checks if dmg file was created

0 commit comments

Comments
 (0)