Skip to content

Commit 77fcca1

Browse files
committed
fix/copy-configure-stubs
1 parent cff55a6 commit 77fcca1

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ phpstan.neon
99
testbench.yaml
1010
vendor
1111
node_modules
12+
.DS_Store

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/admin/package.json', __DIR__.'/package.json');
115+
copy(__DIR__.'/configure-stubs/admin/plugin.css', __DIR__.'/resources/css/plugin.css');
116+
copy(__DIR__.'/configure-stubs/admin/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)