From 70915451742eaa989d584a28ba5ae62ee87d5fc5 Mon Sep 17 00:00:00 2001 From: Clement Boirie Date: Tue, 19 May 2020 10:42:20 +0200 Subject: [PATCH] Remove trailing slash from plugin path when creating PSR4 mapping --- src/Command/ScaffoldPluginCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Command/ScaffoldPluginCommand.php b/src/Command/ScaffoldPluginCommand.php index 1ce795f..c945e81 100644 --- a/src/Command/ScaffoldPluginCommand.php +++ b/src/Command/ScaffoldPluginCommand.php @@ -264,8 +264,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) { try { $composerJson = $composerFile->read(); - $composerJson['autoload']['psr-4'][ $pluginNamespace . "\\" ] = $installPath . '/classes/'; - + $composerJson['autoload']['psr-4'][ $pluginNamespace . "\\" ] = rtrim( $installPath, '/' ) . '/classes/'; $composerFile->write( $composerJson ); $output->writeln( "The namespace have been added to the composer.json file !" );