From e51134f1f8d76eb6b4e8b69ce7fa43d1fa7c9aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Fri, 28 Jul 2023 11:58:10 +0200 Subject: [PATCH] Make errors visisble in generation:flush command --- CHANGELOG.md | 1 + src/N98/Magento/Command/Generation/FlushCommand.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4ff5418..9e676f48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ RECENT CHANGES - Imp: #1179: New github:pr command (by Christian Münch) - Imp: #1182: Add debug output if Magento Core Commands cannot be used (by Christian Münch) - Imp: #1185: Do less compatibility checks (by Christian Münch) +- Imp: Print an error if generation:flush command cannot delete a directory (by Christian Münch) - Imp: Update 3rd party dependencies (php-cs-fixer, psysh, phpstan, phpunit, requests, symfony) 7.0.3 diff --git a/src/N98/Magento/Command/Generation/FlushCommand.php b/src/N98/Magento/Command/Generation/FlushCommand.php index 2833a9f7c..f4ff6c6ad 100644 --- a/src/N98/Magento/Command/Generation/FlushCommand.php +++ b/src/N98/Magento/Command/Generation/FlushCommand.php @@ -59,8 +59,11 @@ protected function execute(InputInterface $input, OutputInterface $output) } /* @var $directory \Symfony\Component\Finder\SplFileInfo */ - $filesystem->recursiveRemoveDirectory($directory->getPathname()); - $output->writeln('Removed ' . $directory->getBasename() . ' folder'); + if ($filesystem->recursiveRemoveDirectory($directory->getPathname())) { + $output->writeln('Removed ' . $directory->getBasename() . ' folder'); + } else { + $output->writeln('Failed to remove ' . $directory->getBasename() . ' folder'); + } } return Command::SUCCESS;