Add COMPOSER_NO_DEV environment variable to set the --no-dev flag (#10262)
parent
78583ab678
commit
ebf4cbdc69
|
@ -1163,3 +1163,8 @@ If set to `1`, outputs information about events being dispatched, which can be
|
|||
useful for plugin authors to identify what is firing when exactly.
|
||||
|
||||
← [Libraries](02-libraries.md) | [Schema](04-schema.md) →
|
||||
|
||||
### COMPOSER_NO_DEV
|
||||
|
||||
If set to `1`, it is the equivalent of passing the `--no-dev` arguement to `install` or
|
||||
`update`. You can override this for a single command by setting `COMPOSER_NO_DEV=0`.
|
||||
|
|
|
@ -153,6 +153,12 @@ abstract class BaseCommand extends Command
|
|||
$input->setOption('no-progress', true);
|
||||
}
|
||||
|
||||
if (true == $input->hasOption('no-dev')) {
|
||||
if (!$input->getOption('no-dev') && true == Platform::getEnv('COMPOSER_NO_DEV')) {
|
||||
$input->setOption('no-dev', true);
|
||||
}
|
||||
}
|
||||
|
||||
parent::initialize($input, $output);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue