Skip to content

Commit 39236d8

Browse files
committed
feat: add spinner for theme building process in BuildThemeCommand
1 parent ea09b31 commit 39236d8

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/Console/Command/BuildThemeCommand.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace OpenForgeProject\MageForge\Console\Command;
66

77
use Laravel\Prompts\MultiSelectPrompt;
8+
use Laravel\Prompts\Spinner;
89
use OpenForgeProject\MageForge\Model\ThemeList;
910
use OpenForgeProject\MageForge\Model\ThemePath;
1011
use OpenForgeProject\MageForge\Service\ThemeBuilder\BuilderPool;
@@ -93,12 +94,23 @@ private function processBuildThemes(
9394

9495
if ($isVerbose) {
9596
$io->title(sprintf('Building %d theme(s)', count($themeCodes)));
96-
}
9797

98-
foreach ($themeCodes as $themeCode) {
99-
if (!$this->processTheme($themeCode, $io, $output, $isVerbose, $successList)) {
100-
continue;
98+
foreach ($themeCodes as $themeCode) {
99+
if (!$this->processTheme($themeCode, $io, $output, $isVerbose, $successList)) {
100+
continue;
101+
}
101102
}
103+
} else {
104+
// Nutze Spinner mit der korrekten API
105+
$spinner = new Spinner('✨ Building theme ...');
106+
$spinner->spin(function() use ($themeCodes, $io, $output, $isVerbose, &$successList) {
107+
foreach ($themeCodes as $themeCode) {
108+
if (!$this->processTheme($themeCode, $io, $output, $isVerbose, $successList)) {
109+
continue;
110+
}
111+
}
112+
return true;
113+
});
102114
}
103115

104116
$this->displayBuildSummary($io, $successList, microtime(true) - $startTime);

0 commit comments

Comments
 (0)