Add COMPOSER_NO_DEV environment variable to set the --no-dev flag (#10262)

main
Yehuda Katz 3 years ago committed by GitHub
parent 78583ab678
commit ebf4cbdc69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save