File tree Expand file tree Collapse file tree 4 files changed +9
-21
lines changed Expand file tree Collapse file tree 4 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 8
8
use IsaEken \ThemeSystem \ThemeSystem ;
9
9
use IsaEken \ThemeSystem \Webpack ;
10
10
11
- class CreateCommand extends Command
11
+ class MakeCommand extends Command
12
12
{
13
13
/**
14
14
* The console command signature.
15
15
*
16
16
* @var string
17
17
*/
18
- protected $ signature = ThemeSystem::CommandPrefix . ' create {name} ' ;
18
+ protected $ signature = ' make:theme {name} ' ;
19
19
20
20
/**
21
21
* The console command description.
@@ -38,19 +38,8 @@ public function handle(): void
38
38
return ;
39
39
}
40
40
41
- $ this ->info ('Creating theme... ' );
42
-
43
- $ dir = theme_system ()->getThemesDirectory () . '/ ' . $ name ;
44
-
45
- File::makeDirectory ($ dir . '/public ' , recursive: true );
46
- File::makeDirectory ($ dir . '/resources/css ' , recursive: true );
47
- File::makeDirectory ($ dir . '/resources/js ' , recursive: true );
48
- File::put ($ dir . '/webpack.mix.js ' , Webpack::generateTheme ());
49
- File::put ($ dir . '/resources/css/app.css ' , '' );
50
- File::put ($ dir . '/resources/js/app.js ' , '' );
51
-
41
+ theme_system ()->make ($ name );
52
42
Artisan::call (ThemeSystem::CommandPrefix . 'publish ' );
53
-
54
43
$ this ->info ("Theme created: $ name " );
55
44
}
56
45
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace IsaEken \ThemeSystem ;
4
4
5
- use IsaEken \ThemeSystem \Commands \CreateCommand ;
5
+ use IsaEken \ThemeSystem \Commands \MakeCommand ;
6
6
use IsaEken \ThemeSystem \Commands \InitializeCommand ;
7
7
use IsaEken \ThemeSystem \Commands \PublishCommand ;
8
8
use IsaEken \ThemeSystem \Illuminate \FileViewFinder ;
@@ -20,7 +20,7 @@ public function configurePackage(Package $package): void
20
20
->hasCommands (
21
21
PublishCommand::class,
22
22
InitializeCommand::class,
23
- CreateCommand ::class,
23
+ MakeCommand ::class,
24
24
);
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -27,9 +27,8 @@ protected function getEnvironmentSetUp($app)
27
27
$ themeName = 'browser-test-theme ' ;
28
28
29
29
if (!theme_system ()->isExists ($ themeName )) {
30
- $ dir = theme_system ()->getThemesDirectory () . '/ ' . $ themeName ;
31
- File::makeDirectory ("$ dir/public " , recursive: true );
32
- File::put ("$ dir/testing.blade.php " , 'Testing ' );
30
+ theme_system ()->make ($ themeName );
31
+ File::put (theme_path ($ themeName ) . "/testing.blade.php " , 'Testing ' );
33
32
}
34
33
35
34
/** @var Router $router */
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ function makeTestingTheme(): string
52
52
assertTrue (file_exists (public_path ($ name )));
53
53
});
54
54
55
- it ('works create command ' , function () {
55
+ it ('works make command ' , function () {
56
56
$ name = Str::of (Str::random ())->lower ()->snake ('- ' )->__toString ();
57
- Artisan::call (ThemeSystem::CommandPrefix . ' create ' . $ name );
57
+ Artisan::call (' make:theme ' . $ name );
58
58
assertTrue (theme_system ()->isExists ($ name ));
59
59
});
60
60
You can’t perform that action at this time.
0 commit comments