Skip to content

Commit

Permalink
Add back twill:module command as deprecated
Browse files Browse the repository at this point in the history
Will be removed in Twill 3.0 in favor of twill:make:module
  • Loading branch information
ifox committed Jun 22, 2020
1 parent 04d671d commit 50e241d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
44 changes: 44 additions & 0 deletions src/Commands/ModuleMakeDeprecated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace A17\Twill\Commands;

use Illuminate\Support\Str;

class ModuleMakeDeprecated extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'twill:module {moduleName}
{--B|hasBlocks}
{--T|hasTranslation}
{--S|hasSlug}
{--M|hasMedias}
{--F|hasFiles}
{--P|hasPosition}
{--R|hasRevisions}
{--all}';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Create a new Twill Module (deprecated, use twill:make:module)';

/**
* Executes the console command.
*
* @return mixed
*/
public function handle()
{
$this->call('twill:make:module', [
'moduleName' => $this->argument('moduleName'),
] + collect($this->options())->mapWithKeys(function ($value, $key) {
return ["--{$key}" => $value];
})->toArray());
}
}
8 changes: 5 additions & 3 deletions src/TwillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

namespace A17\Twill;

use A17\Twill\Commands\BlockMake;
use A17\Twill\Commands\Build;
use A17\Twill\Commands\CreateSuperAdmin;
use A17\Twill\Commands\Dev;
use A17\Twill\Commands\GenerateBlocks;
use A17\Twill\Commands\Install;
use A17\Twill\Commands\ModuleMake;
use A17\Twill\Commands\BlockMake;
use A17\Twill\Commands\ListIcons;
use A17\Twill\Commands\ListBlocks;
use A17\Twill\Commands\ListIcons;
use A17\Twill\Commands\ModuleMake;
use A17\Twill\Commands\ModuleMakeDeprecated;
use A17\Twill\Commands\RefreshLQIP;
use A17\Twill\Commands\Update;
use A17\Twill\Http\ViewComposers\ActiveNavigation;
Expand Down Expand Up @@ -293,6 +294,7 @@ private function registerCommands()
$this->commands([
Install::class,
ModuleMake::class,
ModuleMakeDeprecated::class,
BlockMake::class,
ListIcons::class,
ListBlocks::class,
Expand Down

0 comments on commit 50e241d

Please sign in to comment.