diff --git a/src/Command/UpdateCommand.php b/src/Command/UpdateCommand.php index d1f02d957..021c54db0 100644 --- a/src/Command/UpdateCommand.php +++ b/src/Command/UpdateCommand.php @@ -10,6 +10,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Webmozart\PathUtil\Path; /** * Class UpdateCommand. @@ -41,8 +42,7 @@ protected function commandRequiresAuthentication(): bool { */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->getPharPath()) { - throw new RuntimeException('update only works when running the phar version of ' . $this->getApplication() - ->getName() . '.'); + throw new RuntimeException('update only works when running the phar version of ' . $this->getApplication()->getName() . '.'); } $updater = new Updater($this->getPharPath(), FALSE); @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { */ public function getPharPath(): string { if (!isset($this->pharPath)) { - $this->pharPath = Phar::running(TRUE); + $this->setPharPath(Phar::running(FALSE)); } return $this->pharPath; } @@ -82,7 +82,7 @@ public function getPharPath(): string { * @param string $pharPath */ public function setPharPath(string $pharPath): void { - $this->pharPath = $pharPath; + $this->pharPath = Path::canonicalize($pharPath); } } diff --git a/src/SelfUpdate/Strategy/GithubStrategy.php b/src/SelfUpdate/Strategy/GithubStrategy.php index 3e6f4dcd0..72ecef50d 100644 --- a/src/SelfUpdate/Strategy/GithubStrategy.php +++ b/src/SelfUpdate/Strategy/GithubStrategy.php @@ -1,20 +1,14 @@