Skip to content

Commit

Permalink
FIX Don't include installer for non-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed May 8, 2024
1 parent 1dfa92a commit 715250d
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,25 +678,23 @@ private function needsInstallerVersion(): bool
if (in_array($this->repoName, NO_INSTALLER_REPOS)) {
return false;
}
// We shouldn't try to infer the installer version for regular repositories
// that we don't know anything about
if (empty($this->repoData)) {
if (!file_exists($this->composerJsonPath)) {
return false;
}
$json = $this->getComposerJsonContent();
$silverstripeRepoTypes = [
'silverstripe-vendormodule',
'silverstripe-module',
'silverstripe-recipe',
'silverstripe-theme',
];
return isset($json->type) && in_array($json->type, $silverstripeRepoTypes);
// Recipes don't need installer unless they're handled in FORCE_INSTALLER_REPOS above
if (!empty($this->repoData) && $this->repoData['type'] === 'recipe') {
return false;
}
if ($this->repoData['type'] === 'recipe') {
// We shouldn't try to infer the installer version for regular repositories
if (!file_exists($this->composerJsonPath)) {
return false;
}
return true;
$json = $this->getComposerJsonContent();
// Only include installer for Silverstipe CMS modules
$silverstripeRepoTypes = [
'silverstripe-vendormodule',
'silverstripe-module',
'silverstripe-recipe',
'silverstripe-theme',
];
return isset($json->type) && in_array($json->type, $silverstripeRepoTypes);
}

private function getComposerJsonContent(): ?stdClass
Expand Down

0 comments on commit 715250d

Please sign in to comment.