Skip to content

Commit

Permalink
🧑‍💻 Load the fse:init command in production but require confirmation (
Browse files Browse the repository at this point in the history
Fixes #6) (#7)
  • Loading branch information
Log1x authored Apr 22, 2024
1 parent 1de6151 commit c2f8395
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AcornFseHelperServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AcornFseHelperServiceProvider extends ServiceProvider
*/
public function boot()
{
if ($this->app->runningInConsole() && ! $this->app->isProduction()) {
if ($this->app->runningInConsole()) {
$this->loadViewsFrom(__DIR__.'/../resources/views', 'acorn-fse-helper');

$this->commands([
Expand Down
7 changes: 7 additions & 0 deletions src/Console/Commands/FseInitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ public function handle(): void
return;
}

if (
$this->getLaravel()->isProduction() &&
! confirm('<fg=white>You are currently in</> <fg=red;options=bold>Production</>. <fg=white>Do you still wish to continue?</>', default: false)
) {
return;
}

$this->components->info('Initializing <fg=blue>full-site editing</> support in the active theme.');

$this->task('Enabling <fg=blue>theme support</> for block templates', $this->handleSupport());
Expand Down

0 comments on commit c2f8395

Please sign in to comment.