Skip to content

Commit dd9ef18

Browse files
authored
Make sure packages are there for reading config (#419)
1 parent 51df909 commit dd9ef18

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/CosyComposer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ public function run()
551551
throw new \InvalidArgumentException('Invalid composer.json file');
552552
}
553553
$config = $this->ensureFreshConfig($composer_json_data);
554+
$this->doComposerInstall($config);
555+
$config = $this->ensureFreshConfig($composer_json_data);
554556
$this->client = $this->getClient($this->slug);
555557
$this->privateClient = $this->getClient($this->slug);
556558
$this->privateClient->authenticate($this->userToken, null);
@@ -592,11 +594,12 @@ public function run()
592594
$this->log($this->getLastStdErr());
593595
throw new \Exception('There was an error trying to switch to default branch');
594596
}
595-
// Re-read the composer.json file, since it can be different on the default branch,
597+
// Re-read the composer.json file, since it can be different on the default branch.
598+
$this->doComposerInstall($config);
596599
$composer_json_data = $this->composerGetter->getComposerJsonData();
600+
$config = $this->ensureFreshConfig($composer_json_data);
597601
$this->runAuthExport($hostname);
598602
$this->handleDrupalContribSa($composer_json_data);
599-
$config = $this->ensureFreshConfig($composer_json_data);
600603
$this->handleTimeIntervalSetting($config);
601604
$lock_file = $this->composerJsonDir . '/composer.lock';
602605
$initial_composer_lock_data = false;

test/integration/issues/Issue145Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function handleExecutorReturnCallback($cmd, &$return)
4141

4242
case ['composer', 'install', '--no-ansi', '-n']:
4343
$this->numberOfIstalls++;
44-
if ($this->numberOfIstalls === 3) {
44+
if ($this->numberOfIstalls === 5) {
4545
$return = 1;
4646
}
4747
break;

0 commit comments

Comments
 (0)