1
0

Allows to skip building assets

This commit is contained in:
Richard Dern 2024-04-28 11:34:20 +02:00
parent 0f6d7168b4
commit 9aca3bc890

View File

@ -17,7 +17,7 @@ class Render extends Command
* *
* @var string * @var string
*/ */
protected $signature = 'bundle:render { --i|ignore-cache : Ignore cache }'; protected $signature = 'bundle:render { --a|assets : Rebuild assets }';
/** /**
* The console command description. * The console command description.
@ -31,9 +31,13 @@ class Render extends Command
*/ */
public function handle() public function handle()
{ {
$this->output->write('Building assets... '); if ($this->options('assets')) {
Process::run('npm run build')->throw(); $this->output->write('Building assets... ');
$this->info('OK'); Process::run('npm run build')->throw();
$this->info('OK');
$this->call('cache:clear');
}
$path = '/'; $path = '/';
$bundles = Bundle::findBundles(Storage::disk(env('CONTENT_DISK')), $path, true); $bundles = Bundle::findBundles(Storage::disk(env('CONTENT_DISK')), $path, true);
@ -41,7 +45,7 @@ public function handle()
$progress->start(); $progress->start();
foreach ($bundles as $bundle) { foreach ($bundles as $bundle) {
$result = $bundle->render($this->option('ignore-cache')); $result = $bundle->render();
foreach ($result as $path => $content) { foreach ($result as $path => $content) {
if (!Str::contains($path, '.')) { if (!Str::contains($path, '.')) {