@@ -25,6 +25,7 @@ public function __construct(Composer $composer)
2525
2626 public function handle (): int
2727 {
28+ $ ds = DIRECTORY_SEPARATOR ;
2829 $ name = Str::studly ($ this ->argument ('name ' ));
2930 $ nameSlug = Str::slug ($ this ->argument ('name ' ));
3031
@@ -42,25 +43,25 @@ public function handle(): int
4243 $ this ->line ("> Creating composer.json file.. " );
4344
4445 File::ensureDirectoryExists (module_path ($ name ));
45- File::makeDirectory (module_path ("{ $ name} / src" ));
46- File::makeDirectory (module_path ("{ $ name} / src/ Providers" ));
46+ File::makeDirectory (module_path ($ name. $ ds . ' src ' ));
47+ File::makeDirectory (module_path ($ name. $ ds . ' src ' . $ ds . ' Providers ' ));
4748
48- $ composerContent = File::get (__DIR__ .' /../../ stubs/ composer.json.stub ' );
49+ $ composerContent = File::get (__DIR__ .$ ds . ' .. ' . $ ds . ' .. ' . $ ds . ' stubs ' . $ ds . ' composer.json.stub ' );
4950 $ composerContent = preg_replace ('/_MODULENAME_/ ' , $ name , $ composerContent );
5051 $ composerContent = preg_replace ('/_MODULENAMESLUG_/ ' , $ nameSlug , $ composerContent );
5152
5253 File::put (module_path ("{$ name }/composer.json " ), $ composerContent );
5354
5455 $ this ->line ("> Creating {$ name }ServiceProvider file.. " );
5556
56- $ providerContent = File::get (__DIR__ .' /../../ stubs/ModuleNameServiceProvider.php.stub ' );
57+ $ providerContent = File::get (__DIR__ .$ ds . ' .. ' . $ ds . ' .. ' . $ ds . ' stubs/ModuleNameServiceProvider.php.stub ' );
5758 $ providerContent = preg_replace ('/_MODULENAME_/ ' , $ name , $ providerContent );
5859
59- File::put (module_path ("{ $ name} / src/ Providers/ { $ name} ServiceProvider.php " ), $ providerContent );
60+ File::put (module_path ($ name. $ ds . ' src ' . $ ds . ' Providers ' . $ ds . $ name. ' ServiceProvider.php ' ), $ providerContent );
6061
6162 $ this ->line ("> Running composer install modules/ {$ nameSlug }.. " );
6263
63- $ installProcess = new Process (['composer ' , 'require ' , " modules/ { $ nameSlug}" ], null );
64+ $ installProcess = new Process (['composer ' , 'require ' , ' modules ' . $ ds . $ nameSlug ], null );
6465 $ installProcess ->setWorkingDirectory (base_path ());
6566 $ installProcess ->mustRun (function ($ type , $ buffer ) {
6667 $ this ->getOutput ()->write ($ buffer );
0 commit comments