Skip to content

Commit

Permalink
Merge pull request #489 from caendesilva/patch-1
Browse files Browse the repository at this point in the history
Throw a more descriptive exception when the binary was not created
  • Loading branch information
owenvoke committed Dec 12, 2023
2 parents 23699dd + d3bb835 commit 9afbb03
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Commands/BuildCommand.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9afbb03

Please sign in to comment.