Skip to content

Commit

Permalink
Merge pull request #61 from huangdijia/fix
Browse files Browse the repository at this point in the history
Fix the bug that cannot execute after install swoole-cli
  • Loading branch information
huangzhhui authored Oct 14, 2022
2 parents bed64ab + cf7f81a commit 5313c2b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ vendor/
*.lock
box
.box
*.phar
*.phar
.bashrc
2 changes: 1 addition & 1 deletion src/app/DownloadHandler/PintHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle(string $pkgName, string $version, array $options = []): ?
throw new \RuntimeException('The definition of package is invalid');
}

$savePath = Phar::running(false) ?: $this->runtimePath . DIRECTORY_SEPARATOR;
$savePath = $this->runtimePath . DIRECTORY_SEPARATOR;
$file = $this->download($url, $savePath, 0755);
if (! file_exists($savePath)) {
throw new \RuntimeException('Download failed, cannot locate the file in local.');
Expand Down
2 changes: 1 addition & 1 deletion src/app/DownloadHandler/SwooleCliHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function handle(string $pkgName, string $version, array $options = []): ?
$assetName = $this->replaces($matchRule, ['version' => $specifiedVersion]);
}
$url = $this->fetchDownloadUrlFromGithubRelease($assetName, $definition->getRepo(), $specifiedVersion);
$savePath = Phar::running(false) ?: $this->runtimePath . DIRECTORY_SEPARATOR;
$savePath = $this->runtimePath . DIRECTORY_SEPARATOR;

$file = $this->download($url, $savePath, 0755);
if (! file_exists($savePath)) {
Expand Down

0 comments on commit 5313c2b

Please sign in to comment.