Skip to content

Commit f7df17b

Browse files
Unpack by default when running composer require
1 parent 9418170 commit f7df17b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Command/RequireCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ public function __construct(PackageResolver $resolver)
3232
protected function configure()
3333
{
3434
parent::configure();
35-
$this->addOption('unpack', null, InputOption::VALUE_NONE, 'Unpack Symfony packs in composer.json.');
35+
$this->addOption('no-unpack', null, InputOption::VALUE_NONE, 'Disable unpacking Symfony packs in composer.json.');
36+
$this->addOption('unpack', null, InputOption::VALUE_NONE, '[DEPRECATED] Unpacking is now enabled by default.');
3637
}
3738

3839
protected function execute(InputInterface $input, OutputInterface $output)
3940
{
40-
$unpack = $input->getOption('unpack');
41+
if ($input->getOption('unpack')) {
42+
$this->getIO()->writeError('<warning>The "--unpack" command line option is deprecated; unpacking is now enabled by default.</warning>');
43+
}
44+
4145
$packages = $this->resolver->resolve($input->getArgument('packages'), true);
4246
if ($packages) {
4347
$input->setArgument('packages', $this->resolver->resolve($input->getArgument('packages'), true));
44-
} elseif ($unpack) {
45-
$this->getIO()->writeError('<error>--unpack is incompatible with the interactive mode.</>');
46-
47-
return 1;
4848
}
4949

5050
if (version_compare('2.0.0', PluginInterface::PLUGIN_API_VERSION, '>') && $input->hasOption('no-suggest')) {
@@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5353

5454
$ret = parent::execute($input, $output) ?? 0;
5555

56-
if (0 !== $ret || $input->getOption('no-update')) {
56+
if (0 !== $ret || $input->getOption('no-unpack') || $input->getOption('no-update')) {
5757
return $ret;
5858
}
5959

0 commit comments

Comments
 (0)