@@ -114,26 +114,38 @@ private function processBuildThemes(
114114 ): int {
115115 $ startTime = microtime (true );
116116 $ successList = [];
117+ $ totalThemes = count ($ themeCodes );
117118
118119 if ($ isVerbose ) {
119- $ io ->title (sprintf ('Building %d theme(s) ' , count ( $ themeCodes ) ));
120+ $ io ->title (sprintf ('Building %d theme(s) ' , $ totalThemes ));
120121
121122 foreach ($ themeCodes as $ themeCode ) {
122123 if (!$ this ->processTheme ($ themeCode , $ io , $ output , $ isVerbose , $ successList )) {
123124 continue ;
124125 }
125126 }
126127 } 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 ));
134147 }
135- return true ;
136- });
148+ }
137149 }
138150
139151 $ this ->displayBuildSummary ($ io , $ successList , microtime (true ) - $ startTime );
@@ -195,18 +207,38 @@ private function processTheme(
195207 */
196208 private function displayBuildSummary (SymfonyStyle $ io , array $ successList , float $ duration ): void
197209 {
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+
198218 if (empty ($ successList )) {
199219 $ io ->warning ('No themes were built successfully. ' );
200220 return ;
201221 }
202222
203- $ io ->success (sprintf (
204- "Build process completed in %.2f seconds with the following results: " ,
205- $ duration
206- ));
207-
208223 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+ }
210240 }
241+
242+ $ io ->newLine ();
211243 }
212244}
0 commit comments