Skip to content

Unpack by default when running composer require #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Command/RequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public function __construct(PackageResolver $resolver)
protected function configure()
{
parent::configure();
$this->addOption('unpack', null, InputOption::VALUE_NONE, 'Unpack Symfony packs in composer.json.');
$this->addOption('no-unpack', null, InputOption::VALUE_NONE, 'Disable unpacking Symfony packs in composer.json.');
$this->addOption('unpack', null, InputOption::VALUE_NONE, '[DEPRECATED] Unpacking is now enabled by default.');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$unpack = $input->getOption('unpack');
if ($input->getOption('unpack')) {
$this->getIO()->writeError('<warning>The "--unpack" command line option is deprecated; unpacking is now enabled by default.</warning>');
}

$packages = $this->resolver->resolve($input->getArgument('packages'), true);
if ($packages) {
$input->setArgument('packages', $this->resolver->resolve($input->getArgument('packages'), true));
} elseif ($unpack) {
$this->getIO()->writeError('<error>--unpack is incompatible with the interactive mode.</>');

return 1;
}

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

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

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

Expand Down