Skip to content

Commit fd68c6c

Browse files
authored
Merge pull request #23 from filamentphp/fix/copy-configure-stubs
fix copy of configure stubs
2 parents 5919ba7 + 981eb86 commit fd68c6c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

configure.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
$authorEmail = ask('Author email', $gitEmail);
99

1010
$usernameGuess = explode(':', run('git config remote.origin.url'))[1];
11-
$usernameGuess = dirname($usernameGuess);
12-
$usernameGuess = basename($usernameGuess);
11+
if ($usernameGuess) {
12+
$usernameGuess = dirname($usernameGuess);
13+
$usernameGuess = basename($usernameGuess);
14+
}
1315
$authorUsername = ask('Author username', $usernameGuess);
1416

1517
$vendorName = ask('Vendor name', $authorUsername);
@@ -83,9 +85,6 @@
8385
]);
8486
} else {
8587
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');
8988
safeUnlink(__DIR__.'/src/SkeletonServiceProvider.php');
9089
safeUnlink(__DIR__.'/src/Skeleton.php');
9190
removeDirectory(__DIR__.'/config');
@@ -99,9 +98,6 @@
9998
removeDirectory(__DIR__.'/src/Testing');
10099
} else {
101100
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');
105101
}
106102

107103
remove_composer_filament_deps([
@@ -110,6 +106,16 @@
110106
]);
111107
}
112108

109+
if ($isTheme) {
110+
copy(__DIR__.'/configure-stubs/theme/package.json', __DIR__.'/package.json');
111+
copy(__DIR__.'/configure-stubs/theme/plugin.css', __DIR__.'/resources/css/plugin.css');
112+
copy(__DIR__.'/configure-stubs/theme/tailwind.config.js', __DIR__.'/tailwind.config.js');
113+
} else {
114+
copy(__DIR__.'/configure-stubs/package/package.json', __DIR__.'/package.json');
115+
copy(__DIR__.'/configure-stubs/package/plugin.css', __DIR__.'/resources/css/plugin.css');
116+
copy(__DIR__.'/configure-stubs/package/tailwind.config.js', __DIR__.'/tailwind.config.js');
117+
}
118+
113119
$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes());
114120

115121
foreach ($files as $file) {

0 commit comments

Comments
 (0)