Config - always respect COMPOSER_DISCARD_CHANGES
parent
a1bc424a06
commit
13421f7d66
|
@ -376,7 +376,8 @@ class Config
|
||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
case 'discard-changes':
|
case 'discard-changes':
|
||||||
if ($env = $this->getComposerEnv('COMPOSER_DISCARD_CHANGES')) {
|
$env = $this->getComposerEnv('COMPOSER_DISCARD_CHANGES');
|
||||||
|
if ($env !== false) {
|
||||||
if (!in_array($env, ['stash', 'true', 'false', '1', '0'], true)) {
|
if (!in_array($env, ['stash', 'true', 'false', '1', '0'], true)) {
|
||||||
throw new \RuntimeException(
|
throw new \RuntimeException(
|
||||||
"Invalid value for COMPOSER_DISCARD_CHANGES: {$env}. Expected 1, 0, true, false or stash"
|
"Invalid value for COMPOSER_DISCARD_CHANGES: {$env}. Expected 1, 0, true, false or stash"
|
||||||
|
@ -519,7 +520,7 @@ class Config
|
||||||
* This should be used to read COMPOSER_ environment variables
|
* This should be used to read COMPOSER_ environment variables
|
||||||
* that overload config values.
|
* that overload config values.
|
||||||
*
|
*
|
||||||
* @return string|bool
|
* @return string|false
|
||||||
*/
|
*/
|
||||||
private function getComposerEnv(string $var)
|
private function getComposerEnv(string $var)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue