Skip to content

Commit ff0dc6c

Browse files
committed
minor refactoring
1 parent 1c5a0cb commit ff0dc6c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected File doApply(MacPackager packager) throws Exception {
8787
// creates image
8888
Logger.info("Creating image: " + tempDmgFile.getAbsolutePath());
8989
String osArchitecture = System.getProperty("os.arch");
90-
boolean isAarch64 = osArchitecture.toLowerCase().equals("aarch64");
90+
boolean isAarch64 = osArchitecture.equalsIgnoreCase("aarch64");
9191
String fileSystem = isAarch64 ? "APFS" : "HFS+";
9292
Logger.warn(osArchitecture + " architecture detected. Using " + fileSystem + " filesystem");
9393
execute("hdiutil", "create", "-srcfolder", appFolder, "-volname", volumeName, "-ov", "-fs", fileSystem, "-format", "UDRW", tempDmgFile);
@@ -100,10 +100,9 @@ protected File doApply(MacPackager packager) throws Exception {
100100
// mounts image
101101
Logger.info("Mounting image: " + tempDmgFile.getAbsolutePath());
102102
String result = execute("hdiutil", "attach", "-readwrite", "-noverify", "-noautoopen", tempDmgFile);
103-
Optional<String> optDeviceName = Arrays.asList(result.split("\n"))
104-
.stream()
103+
Optional<String> optDeviceName = Arrays.stream(result.split("\n"))
105104
.filter(s -> s.contains(mountFolder.getAbsolutePath()))
106-
.map(s -> StringUtils.normalizeSpace(s))
105+
.map(StringUtils::normalizeSpace)
107106
.map(s -> s.split(" ")[0])
108107
.findFirst();
109108
optDeviceName.ifPresent(deviceName -> Logger.info("- Device name: " + deviceName));

0 commit comments

Comments
 (0)