Skip to content

Commit 5313c2b

Browse files
authored
Merge pull request #61 from huangdijia/fix
Fix the bug that cannot execute after install swoole-cli
2 parents bed64ab + cf7f81a commit 5313c2b

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ vendor/
1313
*.lock
1414
box
1515
.box
16-
*.phar
16+
*.phar
17+
.bashrc

src/app/DownloadHandler/PintHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function handle(string $pkgName, string $version, array $options = []): ?
4242
throw new \RuntimeException('The definition of package is invalid');
4343
}
4444

45-
$savePath = Phar::running(false) ?: $this->runtimePath . DIRECTORY_SEPARATOR;
45+
$savePath = $this->runtimePath . DIRECTORY_SEPARATOR;
4646
$file = $this->download($url, $savePath, 0755);
4747
if (! file_exists($savePath)) {
4848
throw new \RuntimeException('Download failed, cannot locate the file in local.');

src/app/DownloadHandler/SwooleCliHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function handle(string $pkgName, string $version, array $options = []): ?
4747
$assetName = $this->replaces($matchRule, ['version' => $specifiedVersion]);
4848
}
4949
$url = $this->fetchDownloadUrlFromGithubRelease($assetName, $definition->getRepo(), $specifiedVersion);
50-
$savePath = Phar::running(false) ?: $this->runtimePath . DIRECTORY_SEPARATOR;
50+
$savePath = $this->runtimePath . DIRECTORY_SEPARATOR;
5151

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

0 commit comments

Comments
 (0)