Allow assets publishing on module download command.

Add a --demo flag that runs all optional flags.
parent 4f4002a1
...@@ -40,12 +40,15 @@ class DownloadModuleCommand extends Command ...@@ -40,12 +40,15 @@ class DownloadModuleCommand extends Command
$commands = [ $commands = [
$composer.' dump-autoload', $composer.' dump-autoload',
]; ];
if ($this->option('migrations') === true) { if ($this->option('migrations') === true || $this->option('demo') === true) {
$commands[] = "php artisan module:migrate $name"; $commands[] = "php artisan module:migrate $name";
} }
if ($this->option('seeds') === true) { if ($this->option('seeds') === true || $this->option('demo') === true) {
$commands[] = "php artisan module:seed $name"; $commands[] = "php artisan module:seed $name";
} }
if ($this->option('assets') === true || $this->option('demo') === true) {
$commands[] = "php artisan module:publish $name";
}
$process = new Process(implode(' && ', $commands)); $process = new Process(implode(' && ', $commands));
if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) { if ('\\' !== DIRECTORY_SEPARATOR && file_exists('/dev/tty') && is_readable('/dev/tty')) {
$process->setTty(true); $process->setTty(true);
...@@ -78,6 +81,8 @@ class DownloadModuleCommand extends Command ...@@ -78,6 +81,8 @@ class DownloadModuleCommand extends Command
return [ return [
['migrations', 'm', InputOption::VALUE_NONE, 'Run the module migrations', null], ['migrations', 'm', InputOption::VALUE_NONE, 'Run the module migrations', null],
['seeds', 's', InputOption::VALUE_NONE, 'Run the module seeds', null], ['seeds', 's', InputOption::VALUE_NONE, 'Run the module seeds', null],
['assets', 'a', InputOption::VALUE_NONE, 'Publish the module assets', null],
['demo', 'd', InputOption::VALUE_NONE, 'Run all optional flags', null],
]; ];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment