diff --git a/.gitignore b/.gitignore index e982c25..9e95324 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ vendor/ *.lock box .box -*.phar \ No newline at end of file +*.phar +.bashrc \ No newline at end of file diff --git a/src/app/DownloadHandler/PintHandler.php b/src/app/DownloadHandler/PintHandler.php index 1e1c31d..1f4095c 100644 --- a/src/app/DownloadHandler/PintHandler.php +++ b/src/app/DownloadHandler/PintHandler.php @@ -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.'); diff --git a/src/app/DownloadHandler/SwooleCliHandler.php b/src/app/DownloadHandler/SwooleCliHandler.php index 0b864e6..25863aa 100644 --- a/src/app/DownloadHandler/SwooleCliHandler.php +++ b/src/app/DownloadHandler/SwooleCliHandler.php @@ -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)) {