|
83 | 83 | ]); |
84 | 84 | } else { |
85 | 85 | if ($isTheme) { |
86 | | - copy(__DIR__ . '/configure-stubs/theme/package.json', __DIR__ . '/package.json'); |
87 | | - copy(__DIR__ . '/configure-stubs/theme/plugin.css', __DIR__ . '/resources/css/plugin.css'); |
88 | | - copy(__DIR__ . '/configure-stubs/theme/tailwind.config.js', __DIR__ . '/tailwind.config.js'); |
89 | | - safeUnlink(__DIR__ . '/src/SkeletonServiceProvider.php'); |
90 | | - safeUnlink(__DIR__ . '/src/Skeleton.php'); |
91 | | - removeDirectory(__DIR__ . '/config'); |
92 | | - removeDirectory(__DIR__ . '/database'); |
93 | | - removeDirectory(__DIR__ . '/stubs'); |
94 | | - removeDirectory(__DIR__ . '/resources/js'); |
95 | | - removeDirectory(__DIR__ . '/resources/lang'); |
96 | | - removeDirectory(__DIR__ . '/resources/views'); |
97 | | - removeDirectory(__DIR__ . '/src/Commands'); |
98 | | - removeDirectory(__DIR__ . '/src/Facades'); |
99 | | - removeDirectory(__DIR__ . '/src/Testing'); |
| 86 | + copy(__DIR__.'/configure-stubs/theme/package.json', __DIR__.'/package.json'); |
| 87 | + copy(__DIR__.'/configure-stubs/theme/plugin.css', __DIR__.'/resources/css/plugin.css'); |
| 88 | + copy(__DIR__.'/configure-stubs/theme/tailwind.config.js', __DIR__.'/tailwind.config.js'); |
| 89 | + safeUnlink(__DIR__.'/src/SkeletonServiceProvider.php'); |
| 90 | + safeUnlink(__DIR__.'/src/Skeleton.php'); |
| 91 | + removeDirectory(__DIR__.'/config'); |
| 92 | + removeDirectory(__DIR__.'/database'); |
| 93 | + removeDirectory(__DIR__.'/stubs'); |
| 94 | + removeDirectory(__DIR__.'/resources/js'); |
| 95 | + removeDirectory(__DIR__.'/resources/lang'); |
| 96 | + removeDirectory(__DIR__.'/resources/views'); |
| 97 | + removeDirectory(__DIR__.'/src/Commands'); |
| 98 | + removeDirectory(__DIR__.'/src/Facades'); |
| 99 | + removeDirectory(__DIR__.'/src/Testing'); |
100 | 100 | } else { |
101 | | - safeUnlink(__DIR__ . '/src/SkeletonTheme.php'); |
102 | | - copy(__DIR__ . '/configure-stubs/package/package.json', __DIR__ . '/package.json'); |
103 | | - copy(__DIR__ . '/configure-stubs/package/plugin.css', __DIR__ . '/resources/css/plugin.css'); |
104 | | - copy(__DIR__ . '/configure-stubs/package/tailwind.config.js', __DIR__ . '/tailwind.config.js'); |
| 101 | + safeUnlink(__DIR__.'/src/SkeletonTheme.php'); |
| 102 | + copy(__DIR__.'/configure-stubs/package/package.json', __DIR__.'/package.json'); |
| 103 | + copy(__DIR__.'/configure-stubs/package/plugin.css', __DIR__.'/resources/css/plugin.css'); |
| 104 | + copy(__DIR__.'/configure-stubs/package/tailwind.config.js', __DIR__.'/tailwind.config.js'); |
105 | 105 | } |
106 | 106 |
|
107 | 107 | remove_composer_filament_deps([ |
|
186 | 186 | confirm('Execute `composer install` and run tests?') && run('composer install && composer test'); |
187 | 187 |
|
188 | 188 | if (confirm('Let this script delete itself?', true)) { |
189 | | - removeDirectory(__DIR__ . '/configure-stubs'); |
| 189 | + removeDirectory(__DIR__.'/configure-stubs'); |
190 | 190 | unlink(__FILE__); |
191 | 191 | } |
192 | 192 |
|
@@ -377,12 +377,17 @@ function replaceForAllOtherOSes(): array |
377 | 377 | return explode( PHP_EOL, run( 'grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|vendor_name|vendor_slug|[email protected]" --exclude-dir=vendor ./* ./.github/* | grep -v '. basename( __FILE__))); |
378 | 378 | } |
379 | 379 |
|
380 | | -function removeDirectory($dir): void { |
| 380 | +function removeDirectory($dir): void |
| 381 | +{ |
381 | 382 | if (is_dir($dir)) { |
382 | 383 | $objects = scandir($dir); |
383 | 384 | foreach ($objects as $object) { |
384 | | - if ($object != "." && $object != "..") { |
385 | | - if (filetype($dir."/".$object) == "dir") removeDirectory($dir."/".$object); else unlink($dir."/".$object); |
| 385 | + if ($object != '.' && $object != '..') { |
| 386 | + if (filetype($dir.'/'.$object) == 'dir') { |
| 387 | + removeDirectory($dir.'/'.$object); |
| 388 | + } else { |
| 389 | + unlink($dir.'/'.$object); |
| 390 | + } |
386 | 391 | } |
387 | 392 | } |
388 | 393 | rmdir($dir); |
|
0 commit comments