@@ -114,26 +114,38 @@ private function processBuildThemes(
114
114
): int {
115
115
$ startTime = microtime (true );
116
116
$ successList = [];
117
+ $ totalThemes = count ($ themeCodes );
117
118
118
119
if ($ isVerbose ) {
119
- $ io ->title (sprintf ('Building %d theme(s) ' , count ( $ themeCodes ) ));
120
+ $ io ->title (sprintf ('Building %d theme(s) ' , $ totalThemes ));
120
121
121
122
foreach ($ themeCodes as $ themeCode ) {
122
123
if (!$ this ->processTheme ($ themeCode , $ io , $ output , $ isVerbose , $ successList )) {
123
124
continue ;
124
125
}
125
126
}
126
127
} else {
127
- // Nutze Spinner mit der korrekten API
128
- $ spinner = new Spinner ('✨ Building theme ... ' );
129
- $ spinner ->spin (function () use ($ themeCodes , $ io , $ output , $ isVerbose , &$ successList ) {
130
- foreach ($ themeCodes as $ themeCode ) {
131
- if (!$ this ->processTheme ($ themeCode , $ io , $ output , $ isVerbose , $ successList )) {
132
- continue ;
133
- }
128
+ // Use the existing spinner with a customized message
129
+ foreach ($ themeCodes as $ index => $ themeCode ) {
130
+ $ currentTheme = $ index + 1 ;
131
+ // Show which theme is currently being built
132
+ $ themeNameCyan = sprintf ("<fg=cyan>%s</> " , $ themeCode );
133
+ $ spinner = new Spinner (sprintf ("Building %s (%d of %d) ... " , $ themeNameCyan , $ currentTheme , $ totalThemes ));
134
+ $ success = false ;
135
+
136
+ $ spinner ->spin (function () use ($ themeCode , $ io , $ output , $ isVerbose , &$ successList , &$ success ) {
137
+ $ success = $ this ->processTheme ($ themeCode , $ io , $ output , $ isVerbose , $ successList );
138
+ return true ;
139
+ });
140
+
141
+ if ($ success ) {
142
+ // Show that the theme was successfully built
143
+ $ io ->writeln (sprintf (" Building %s (%d of %d) ... <fg=green>done</> " , $ themeNameCyan , $ currentTheme , $ totalThemes ));
144
+ } else {
145
+ // Show that an error occurred while building the theme
146
+ $ io ->writeln (sprintf (" Building %s (%d of %d) ... <fg=red>failed</> " , $ themeNameCyan , $ currentTheme , $ totalThemes ));
134
147
}
135
- return true ;
136
- });
148
+ }
137
149
}
138
150
139
151
$ this ->displayBuildSummary ($ io , $ successList , microtime (true ) - $ startTime );
@@ -195,18 +207,38 @@ private function processTheme(
195
207
*/
196
208
private function displayBuildSummary (SymfonyStyle $ io , array $ successList , float $ duration ): void
197
209
{
210
+ $ io ->newLine ();
211
+ $ io ->success (sprintf (
212
+ "🚀 Build process completed in %.2f seconds with the following results: " ,
213
+ $ duration
214
+ ));
215
+ $ io ->writeln ("Summary: " );
216
+ $ io ->newLine ();
217
+
198
218
if (empty ($ successList )) {
199
219
$ io ->warning ('No themes were built successfully. ' );
200
220
return ;
201
221
}
202
222
203
- $ io ->success (sprintf (
204
- "Build process completed in %.2f seconds with the following results: " ,
205
- $ duration
206
- ));
207
-
208
223
foreach ($ successList as $ success ) {
209
- $ io ->writeln ("✓ $ success " );
224
+ $ parts = explode (': ' , $ success , 2 );
225
+ if (count ($ parts ) === 2 ) {
226
+ $ themeName = $ parts [0 ];
227
+ $ details = $ parts [1 ];
228
+ // Color the builder name in magenta
229
+ if (preg_match ('/(using\s+)([^\s]+)(\s+builder)/ ' , $ details , $ matches )) {
230
+ $ details = str_replace (
231
+ $ matches [0 ],
232
+ $ matches [1 ] . '<fg=magenta> ' . $ matches [2 ] . '</> ' . $ matches [3 ],
233
+ $ details
234
+ );
235
+ }
236
+ $ io ->writeln (sprintf ("✅ <fg=cyan>%s</>: %s " , $ themeName , $ details ));
237
+ } else {
238
+ $ io ->writeln ("✅ $ success " );
239
+ }
210
240
}
241
+
242
+ $ io ->newLine ();
211
243
}
212
244
}
0 commit comments