Skip to content

Commit

Permalink
Make errors visisble in generation:flush command
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Jul 31, 2023
1 parent 1376786 commit e51134f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/N98/Magento/Command/Generation/FlushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

/* @var $directory \Symfony\Component\Finder\SplFileInfo */
$filesystem->recursiveRemoveDirectory($directory->getPathname());
$output->writeln('<info>Removed <comment>' . $directory->getBasename() . '</comment> folder</info>');
if ($filesystem->recursiveRemoveDirectory($directory->getPathname())) {
$output->writeln('<info>Removed <comment>' . $directory->getBasename() . '</comment> folder</info>');
} else {
$output->writeln('<error>Failed to remove <comment>' . $directory->getBasename() . '</comment> folder</error>');
}
}

return Command::SUCCESS;
Expand Down

0 comments on commit e51134f

Please sign in to comment.