Skip to content
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

Add command that shows merge plan path #148

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/Command/ConfigCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Config\Command;

use Composer\Command\BaseCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Yiisoft\Config\Composer\ProcessHelper;

/**
* `ConfigCommand`
*/
final class ConfigCommand extends BaseCommand
{
protected function configure(): void
{
$this
->setName('yii-config-merge-plan');
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
/**
* @psalm-suppress PossiblyNullArgument
* @psalm-suppress DeprecatedMethod
*/
$helper = new ProcessHelper($this->getComposer());
$output->write(
$helper->getPaths()->absolute(
$helper->getMergePlanFile()
)
);

return 0;
}
}
1 change: 1 addition & 0 deletions src/Command/ConfigCommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function getCommands(): array
return [
new CopyCommand(),
new RebuildCommand(),
new ConfigCommand(),
];
}
}