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

satis build doesn't pass config to composer #878

Open
dr-diesel opened this issue Jun 27, 2024 · 0 comments
Open

satis build doesn't pass config to composer #878

dr-diesel opened this issue Jun 27, 2024 · 0 comments

Comments

@dr-diesel
Copy link

dr-diesel commented Jun 27, 2024

Hello,

BuildCommand uses this method to get $composer with config:

        /** @var SatisApplication|ComposerApplication $application */
        $application = $this->getApplication();
        if ($application instanceof SatisApplication) {
            $composer = $application->getComposerWithConfig($config);
        } else {
            $composer = $application->getComposer(true);
        }

public function getComposerWithConfig(mixed $config): ?Composer

Unfortunately BaseCommand already creates $application->composer in BaseCommand::initialize() :

https://github.com/composer/composer/blob/11e5237ad9d9e8f29bdc57d946f87c816320d863/src/Composer/Command/BaseCommand.php#L240

For me solution in Satis was to remove if (null === $this->composer) { in Application::getComposerWithConfig() , called only in BuildCommand. Than $composer is recreated with config from .json "config" key, mentioned in docs here: https://composer.github.io/satis/using

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant