Skip to content

Commit 0da976e

Browse files
committed
Support swoole-cli-macos
1 parent da12a9f commit 0da976e

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

pkgs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
"latest": "v5.0.0",
9595
"release_asset_keyword": "swoole-cli",
9696
"release_asset_match_rule": {
97-
"Linux": "swoole-cli-${{version}}-linux-x64.tar.xz"
97+
"Linux": "swoole-cli-${{version}}-linux-x64.tar.xz",
98+
"Darwin": "swoole-cli-${{version}}-macos-x64.tar.gz"
9899
}
99100
}
100101
}

src/app/DownloadHandler/SwooleCliHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ public function handle(string $pkgName, string $version, array $options = []): ?
7070
$this->logger->info('Unpacked tar.xz file ' . $savePath);
7171
unlink($file->getRealPath());
7272
}
73+
// Is file name ends with .tar.gz?
74+
if (str_ends_with($file->getFilename(), '.tar.gz')) {
75+
$this->logger->info('Unpacking tar.gz file ' . $savePath);
76+
exec(sprintf('tar -xvf %s -C %s', $file->getRealPath(), $savePath));
77+
$this->logger->info('Unpacked tar.gz file ' . $savePath);
78+
unlink($file->getRealPath());
79+
}
7380
$licenseFile = $savePath . 'LICENSE';
7481
// If license file exists, delete it.
7582
if (file_exists($licenseFile)) {

0 commit comments

Comments
 (0)