Skip to content

Commit

Permalink
ENH Don't include installer if it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 26, 2024
1 parent 0e30080 commit e801c61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 0 additions & 5 deletions consts.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,7 @@
];

const NO_INSTALLER_UNLOCKSTEPPED_REPOS = [
'vendor-plugin',
'recipe-plugin',
'api.silverstripe.org',
'cow',
'silverstripe-config',
'markdown-php-codesniffer',
];

const CMS_TO_REPO_MAJOR_VERSIONS = [
Expand Down
13 changes: 12 additions & 1 deletion job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,20 @@ public function getInstallerVersion(): string
}
}
}
// has a lockstepped .x-dev requirement in composer.json
if (file_exists($this->composerJsonPath)) {
$json = json_decode(file_get_contents($this->composerJsonPath));
// We shouldn't try to infer the installer version for regular repositories
// that weren't already detected via the const-based logic above
$silverstripeRepoTypes = [
'silverstripe-vendormodule',
'silverstripe-module',
'silverstripe-recipe',
'silverstripe-theme',
];
if (!isset($json->type) || !in_array($json->type, $silverstripeRepoTypes)) {
return '';
}
// has a lockstepped .x-dev requirement in composer.json
foreach (LOCKSTEPPED_REPOS as $lockedSteppedRepo) {
$composerRepo = 'silverstripe/' . str_replace('silverstripe-', '', $lockedSteppedRepo);
if (isset($json->require->{$composerRepo})) {
Expand Down

0 comments on commit e801c61

Please sign in to comment.