Skip to content

Commit

Permalink
Merge pull request #53 from huangzhhui/swoole-cli-macos
Browse files Browse the repository at this point in the history
Support swoole-cli-macos
  • Loading branch information
huangzhhui authored Oct 11, 2022
2 parents 8a5f203 + 0da976e commit bce010f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkgs.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"latest": "v5.0.0",
"release_asset_keyword": "swoole-cli",
"release_asset_match_rule": {
"Linux": "swoole-cli-${{version}}-linux-x64.tar.xz"
"Linux": "swoole-cli-${{version}}-linux-x64.tar.xz",
"Darwin": "swoole-cli-${{version}}-macos-x64.tar.gz"
}
}
}
7 changes: 7 additions & 0 deletions src/app/DownloadHandler/SwooleCliHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ public function handle(string $pkgName, string $version, array $options = []): ?
$this->logger->info('Unpacked tar.xz file ' . $savePath);
unlink($file->getRealPath());
}
// Is file name ends with .tar.gz?
if (str_ends_with($file->getFilename(), '.tar.gz')) {
$this->logger->info('Unpacking tar.gz file ' . $savePath);
exec(sprintf('tar -xvf %s -C %s', $file->getRealPath(), $savePath));
$this->logger->info('Unpacked tar.gz file ' . $savePath);
unlink($file->getRealPath());
}
$licenseFile = $savePath . 'LICENSE';
// If license file exists, delete it.
if (file_exists($licenseFile)) {
Expand Down

0 comments on commit bce010f

Please sign in to comment.