From 491ae0634a680fb6fb655d9860d25d5bed2d9079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E5=85=B4=E8=8C=82?= Date: Fri, 30 Mar 2018 14:24:04 +0800 Subject: [PATCH] Fix bug for scripts for config command --- src/Composer/Command/ConfigCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 6e457dd78..940f5df65 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -612,6 +612,15 @@ EOT return; } + // handle script + if (preg_match('/^scripts\.(.+)/', $settingKey,$matches)){ + if ($input->getOption('unset')) { + return $this->configSource->removeConfigSetting($settingKey); + } + + return $this->configSource->addConfigSetting($settingKey, $values[0]); + } + throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command'); }