Skip to content

Commit

Permalink
no interactive artisan calling
Browse files Browse the repository at this point in the history
  • Loading branch information
robinklaassen committed Nov 1, 2023
1 parent 83cc7ea commit d76e59c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 2 additions & 6 deletions packages/Updater/Listeners/ArtisanPostUpdateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ public function __construct(ExecutorInterface $artisanExecutor)

public function handle()
{
$this->artisanExecutor->execute('clear-compiled', [
'--force' => true
]);
$this->artisanExecutor->execute('clear-compiled');
$this->artisanExecutor->execute('migrate', [
'--force' => true
]);
$this->artisanExecutor->execute('optimize', [
'--force' => true
]);
$this->artisanExecutor->execute('optimize');
}
}
4 changes: 1 addition & 3 deletions packages/Updater/Listeners/ArtisanPreUpdateListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function __construct(ExecutorInterface $artisanExecutor)

public function handle()
{
$this->artisanExecutor->execute('optimize:clear', [
'--force' => true
]);
$this->artisanExecutor->execute('optimize:clear');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class ArtisanExecutor implements ExecutorInterface
{
public function execute(string $cmd, array $args = []): string
{
$args['--no-interaction'] = true; // programmatic calling
$result = Artisan::call($cmd, $args);
if ($result !== 0) {
throw ExecutorException::artisanResult($cmd, $result);
Expand Down

0 comments on commit d76e59c

Please sign in to comment.