diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index 7443367c..c8ebae02 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -21,6 +21,7 @@ use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Process; +use RuntimeException; use Throwable; use function Laravel\Prompts\text; @@ -162,7 +163,13 @@ private function compile(string $name): BuildCommand $this->output->newLine(); - File::move($this->app->basePath($this->getBinary()).'.phar', $this->app->buildsPath($name)); + $pharPath = $this->app->basePath($this->getBinary()) . '.phar'; + + if (! File::exists($pharPath)) { + throw new RuntimeException('Failed to compile the application.'); + } + + File::move($pharPath, $this->app->buildsPath($name)); return $this; }