fix copy of configure stubs

This commit is contained in:
Adam Weston
2023-01-08 12:38:56 -05:00
parent 5919ba72fe
commit 981eb86071

View File

@@ -8,8 +8,10 @@ $gitEmail = run('git config user.email');
$authorEmail = ask('Author email', $gitEmail); $authorEmail = ask('Author email', $gitEmail);
$usernameGuess = explode(':', run('git config remote.origin.url'))[1]; $usernameGuess = explode(':', run('git config remote.origin.url'))[1];
$usernameGuess = dirname($usernameGuess); if ($usernameGuess) {
$usernameGuess = basename($usernameGuess); $usernameGuess = dirname($usernameGuess);
$usernameGuess = basename($usernameGuess);
}
$authorUsername = ask('Author username', $usernameGuess); $authorUsername = ask('Author username', $usernameGuess);
$vendorName = ask('Vendor name', $authorUsername); $vendorName = ask('Vendor name', $authorUsername);
@@ -83,9 +85,6 @@ if ($formsOnly) {
]); ]);
} else { } else {
if ($isTheme) { 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/SkeletonServiceProvider.php');
safeUnlink(__DIR__.'/src/Skeleton.php'); safeUnlink(__DIR__.'/src/Skeleton.php');
removeDirectory(__DIR__.'/config'); removeDirectory(__DIR__.'/config');
@@ -99,9 +98,6 @@ if ($formsOnly) {
removeDirectory(__DIR__.'/src/Testing'); removeDirectory(__DIR__.'/src/Testing');
} else { } else {
safeUnlink(__DIR__.'/src/SkeletonTheme.php'); 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([ 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/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');
}
$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes()); $files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes());
foreach ($files as $file) { foreach ($files as $file) {