make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); if (!App\Support\SiteProfile::isHn()) { throw new RuntimeException('hn asset publication requires SITE_PROFILE=hn.'); } $theme = config('site.theme', 'EZ'); $build = $theme === 'EZ' ? 'build:hn' : 'build:hardnerd'; if (!is_file(base_path('theme/'.$theme.'/assets/.vite/manifest.json'))) { throw new RuntimeException('Build '.$theme.' first: cd frontends && npm ci && npm run '.$build); } if (!Illuminate\Support\Facades\File::copyDirectory(base_path('theme/'.$theme), public_path('theme/'.$theme))) { throw new RuntimeException('Failed to publish '.$theme.' assets.'); } echo $theme." assets published for hn.\n";