fix/copy-configure-stubs

This commit is contained in:
Adam Weston
2023-01-08 12:28:50 -05:00
parent cff55a6ba4
commit 77fcca19f8
2 changed files with 15 additions and 8 deletions

View File

@@ -8,8 +8,10 @@ $gitEmail = run('git config user.email');
$authorEmail = ask('Author email', $gitEmail);
$usernameGuess = explode(':', run('git config remote.origin.url'))[1];
$usernameGuess = dirname($usernameGuess);
$usernameGuess = basename($usernameGuess);
if ($usernameGuess) {
$usernameGuess = dirname($usernameGuess);
$usernameGuess = basename($usernameGuess);
}
$authorUsername = ask('Author username', $usernameGuess);
$vendorName = ask('Vendor name', $authorUsername);
@@ -83,9 +85,6 @@ if ($formsOnly) {
]);
} else {
if ($isTheme) {
copy(__DIR__.'/configure-stubs/theme/package.json', __DIR__.'/package.json');
copy(__DIR__.'/configure-stubs/theme/plugin.css', __DIR__.'/resources/css/plugin.css');
copy(__DIR__.'/configure-stubs/theme/tailwind.config.js', __DIR__.'/tailwind.config.js');
safeUnlink(__DIR__.'/src/SkeletonServiceProvider.php');
safeUnlink(__DIR__.'/src/Skeleton.php');
removeDirectory(__DIR__.'/config');
@@ -99,9 +98,6 @@ if ($formsOnly) {
removeDirectory(__DIR__.'/src/Testing');
} else {
safeUnlink(__DIR__.'/src/SkeletonTheme.php');
copy(__DIR__.'/configure-stubs/package/package.json', __DIR__.'/package.json');
copy(__DIR__.'/configure-stubs/package/plugin.css', __DIR__.'/resources/css/plugin.css');
copy(__DIR__.'/configure-stubs/package/tailwind.config.js', __DIR__.'/tailwind.config.js');
}
remove_composer_filament_deps([
@@ -110,6 +106,16 @@ if ($formsOnly) {
]);
}
if ($isTheme) {
copy(__DIR__.'/configure-stubs/theme/package.json', __DIR__.'/package.json');
copy(__DIR__.'/configure-stubs/theme/plugin.css', __DIR__.'/resources/css/plugin.css');
copy(__DIR__.'/configure-stubs/theme/tailwind.config.js', __DIR__.'/tailwind.config.js');
} else {
copy(__DIR__.'/configure-stubs/admin/package.json', __DIR__.'/package.json');
copy(__DIR__.'/configure-stubs/admin/plugin.css', __DIR__.'/resources/css/plugin.css');
copy(__DIR__.'/configure-stubs/admin/tailwind.config.js', __DIR__.'/tailwind.config.js');
}
$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes());
foreach ($files as $file) {