diff --git a/src/Service/ThemeBuilder/HyvaThemes/Builder.php b/src/Service/ThemeBuilder/HyvaThemes/Builder.php index 7bc5f33..35fbd09 100644 --- a/src/Service/ThemeBuilder/HyvaThemes/Builder.php +++ b/src/Service/ThemeBuilder/HyvaThemes/Builder.php @@ -225,9 +225,19 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp return false; } + $io->info('Starting watch mode for Hyvä theme...'); + $io->text("Watching directory: $tailwindPath"); + $io->newLine(); + try { chdir($tailwindPath); - passthru('npm run watch'); + $returnCode = 0; + passthru('npm run watch', $returnCode); + + if ($returnCode !== 0) { + $io->error("Watch process exited with error code: $returnCode"); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false; diff --git a/src/Service/ThemeBuilder/MagentoStandard/Builder.php b/src/Service/ThemeBuilder/MagentoStandard/Builder.php index 2b81156..0282e02 100644 --- a/src/Service/ThemeBuilder/MagentoStandard/Builder.php +++ b/src/Service/ThemeBuilder/MagentoStandard/Builder.php @@ -192,8 +192,18 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp return false; } + $io->info('Starting watch mode for Magento Standard theme...'); + $io->text("Theme path: $themePath"); + $io->newLine(); + try { - passthru('node_modules/.bin/grunt watch'); + $returnCode = 0; + passthru('node_modules/.bin/grunt watch', $returnCode); + + if ($returnCode !== 0) { + $io->error("Watch process exited with error code: $returnCode"); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false; diff --git a/src/Service/ThemeBuilder/TailwindCSS/Builder.php b/src/Service/ThemeBuilder/TailwindCSS/Builder.php index 3e03a7e..827cc2f 100644 --- a/src/Service/ThemeBuilder/TailwindCSS/Builder.php +++ b/src/Service/ThemeBuilder/TailwindCSS/Builder.php @@ -197,9 +197,19 @@ public function watch(string $themePath, SymfonyStyle $io, OutputInterface $outp return false; } + $io->info('Starting watch mode for TailwindCSS theme...'); + $io->text("Watching directory: $tailwindPath"); + $io->newLine(); + try { chdir($tailwindPath); - passthru('npm run watch'); + $returnCode = 0; + passthru('npm run watch', $returnCode); + + if ($returnCode !== 0) { + $io->error("Watch process exited with error code: $returnCode"); + return false; + } } catch (\Exception $e) { $io->error('Failed to start watch mode: ' . $e->getMessage()); return false;