Skip to content

Commit eadbbe0

Browse files
dvdkrukmarc0der
authored andcommitted
Moves plaform conversion in asSdkmanPlatform
1 parent cf436ed commit eadbbe0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test/groovy/sdkman/support/UnixUtils.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ package sdkman.support
33
class UnixUtils {
44

55
static getPlatform() {
6-
def os = System.getProperty("os.name")
7-
def arch = System.getProperty("os.arch")
6+
asSdkmanPlatform(System.getProperty("os.name"), System.getProperty("os.arch"))
7+
}
88

9-
if("aarch64".equals(arch)) {
10-
asSdkmanPlatform("LinuxARM64")
11-
} else {
12-
asSdkmanPlatform(os)
9+
static asSdkmanPlatform(platform, architecture = null) {
10+
if("aarch64".equals(architecture)) {
11+
platform += architecture
1312
}
14-
}
1513

16-
static asSdkmanPlatform(platform) {
1714
def result
1815
switch (platform) {
1916
case "Mac OS X":
@@ -28,6 +25,9 @@ class UnixUtils {
2825
case "Linux 32":
2926
result = "Linux32"
3027
break
28+
case "Linuxaarch64":
29+
result = "LinuxARM64"
30+
break;
3131
case "FreeBSD":
3232
result = "FreeBSD"
3333
break

0 commit comments

Comments
 (0)