From 1220b196961f6d861d52c0a245258314763390c5 Mon Sep 17 00:00:00 2001 From: arthurlorenz Date: Wed, 5 Apr 2023 12:55:31 +0200 Subject: [PATCH] Process command arguments should be inserted as array. (#37) --- src/GlobalConfig.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GlobalConfig.php b/src/GlobalConfig.php index a53cc6e..3960a07 100644 --- a/src/GlobalConfig.php +++ b/src/GlobalConfig.php @@ -159,10 +159,12 @@ public function applyGlobalComposerConfig() { $commands[] = 'composer config --global ' . escapeshellcmd($config); } if ($commands) { - $process = new Process($commands); - $process->run(); - if ($process->getExitCode()) { - throw new InvalidArgumentException("Problems settings global composer config with commands: " . $command); + foreach ($commands as $command) { + $process = new Process(explode(' ', $command)); + $process->run(); + if ($process->getExitCode()) { + throw new InvalidArgumentException("Problems settings global composer config with commands: " . $command); + } } } }