Skip to content

Commit 22cb709

Browse files
authored
Fixing bug for arm64 (#52)
* Fixing bug for arm64
1 parent d75cba2 commit 22cb709

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/Service/UtilsService.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,17 @@ public function isMuslLinux(): bool {
198198
}
199199

200200
public function getOsArch(): string {
201+
$arm64_names = array("aarch64", "armv8", "arm64");
201202
$machineType = php_uname('m');
202203
if (str_contains($machineType, 'x86_64')) {
203204
return 'amd64';
204-
} elseif (str_contains($machineType, 'arm64')) { // @codeCoverageIgnoreStart
205-
return 'arm64';
206205
}
207-
return $machineType; // @codeCoverageIgnoreEnd
206+
foreach ($arm64_names as $arm64_name) {
207+
if (str_contains($machineType, $arm64_name)) {
208+
return 'arm64';
209+
}
210+
}
211+
return $machineType; // probably we should log here value or raise an exception
208212
}
209213

210214
public function getCustomAppsDirectory(): string {

0 commit comments

Comments
 (0)