From 2404a793aefd8ba09b7e128138fd273e6d94f77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Sat, 27 Apr 2024 16:18:24 +0200 Subject: [PATCH] Remove patch level in recommended version Related to #1358 --- .../Developer/Module/DetectComposerDependenciesCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/N98/Magento/Command/Developer/Module/DetectComposerDependenciesCommand.php b/src/N98/Magento/Command/Developer/Module/DetectComposerDependenciesCommand.php index 6e1c85ba..b0843888 100644 --- a/src/N98/Magento/Command/Developer/Module/DetectComposerDependenciesCommand.php +++ b/src/N98/Magento/Command/Developer/Module/DetectComposerDependenciesCommand.php @@ -357,6 +357,13 @@ private function formatOutput(array $dependencies): string $output = '"require": { ' . "\n"; foreach ($dependencies as $name => $version) { + + /** + * remove patch level (e.g. -p5) from version + * @link https://github.com/netz98/n98-magerun2/issues/1358 + */ + $version = preg_replace('/-p[0-9]+$/', '', $version); + if ($name === self::COMPOSER_FILE_NOT_FOUND) { $composerFileNotFound .= 'file: ' . $version; }