option('assets')) { $this->output->write('Building assets... '); Process::run('npm run build')->throw(); $this->info('OK'); $this->call('cache:clear'); } $path = '/'; $bundles = Bundle::findBundles(Storage::disk(env('CONTENT_DISK')), $path, true); $progress = progress(label: 'Rendering... ', steps: count($bundles)); $progress->start(); foreach ($bundles as $bundle) { $result = $bundle->render(); foreach ($result as $path => $content) { if (!Str::contains($path, '.')) { $path = Str::finish($path, '/') . 'index.html'; } Storage::disk(env('DIST_DISK'))->put($path, $content); } $progress->advance(); } $progress->finish(); if (confirm('Ready to deploy?')) { $this->output->write('Deploying... '); $source = Str::finish(Storage::disk(env('DIST_DISK'))->path('/'), '/'); $target = env('DEPLOY_TARGET'); $command = sprintf('rsync -az -L --chmod=Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r --chown=caddy:caddy --delete "%s" "%s"', $source, $target); Process::run($command)->throw(); $this->info('OK'); } } }