Skip to content

Commit 608a555

Browse files
committed
fix incorrect array offset
1 parent dfac385 commit 608a555

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SPC/store/pkg/GoXcaddy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public function fetch(string $name, bool $force = false, ?array $config = null):
2929
if (file_exists($go_exec) && file_exists($xcaddy_exec)) {
3030
return;
3131
}
32-
$arch = match (explode('-', $name)[3]) {
32+
$arch = match (explode('-', $name)[2]) {
3333
'x86_64' => 'amd64',
3434
'aarch64' => 'arm64',
3535
default => throw new \InvalidArgumentException('Unsupported architecture: ' . $name),
3636
};
37-
$os = match (explode('-', $name)[4]) {
37+
$os = match (explode('-', $name)[3]) {
3838
'linux' => 'linux',
3939
'macos' => 'darwin',
4040
default => throw new \InvalidArgumentException('Unsupported OS: ' . $name),

0 commit comments

Comments
 (0)