diff --git a/src/Console/BuildCommand.php b/src/Console/BuildCommand.php index 233f590..3777f38 100644 --- a/src/Console/BuildCommand.php +++ b/src/Console/BuildCommand.php @@ -7,6 +7,7 @@ use Illuminate\Support\Collection; use Orchestra\Workbench\BuildParser; use Orchestra\Workbench\Contracts\RecipeManager; +use Orchestra\Workbench\Recipes\Command as CommandRecipe; use Orchestra\Workbench\Workbench; use Symfony\Component\Console\Attribute\AsCommand; @@ -37,7 +38,11 @@ public function handle(ConsoleKernel $kernel, RecipeManager $recipes) ->each(function (array $options, string $name) use ($kernel, $recipes, $commands) { /** @var array $options */ if ($recipes->hasCommand($name)) { - $recipes->command($name)->handle($kernel, $this->output); + tap($recipes->command($name), function ($recipe) use ($options) { + if ($recipe instanceof CommandRecipe) { + $recipe->options = $options; + } + })->handle($kernel, $this->output); return; } diff --git a/src/Recipes/AssetPublishCommand.php b/src/Recipes/AssetPublishCommand.php index fd7b600..94fb0eb 100644 --- a/src/Recipes/AssetPublishCommand.php +++ b/src/Recipes/AssetPublishCommand.php @@ -12,9 +12,7 @@ class AssetPublishCommand extends Command */ public function __construct() { - parent::__construct('vendor:publish', [ - '--force' => true, - ]); + parent::__construct('vendor:publish', []); } /** @@ -32,8 +30,9 @@ protected function commandOptions(): array ->unique() ->all(); - return array_merge([ + return array_merge($this->options, [ '--tag' => $tags, - ], $this->options); + '--force' => true, + ]); } }