Skip to content

Commit

Permalink
Issue #535: Code Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
leonel-lullabot committed Apr 30, 2024
1 parent 74fe0e3 commit 778a0a0
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/ScaffoldInstallerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,26 +282,16 @@ private function installCICommands(): void
$fs->ensureDirectoryExists('./.github/actions');
$fs->copy("$scaffoldPath/github/actions/common", './.github/actions/drainpipe');
foreach ($this->extra['drainpipe']['github'] as $github) {
if ($github === 'PantheonReviewApps') {
if ($github === 'PantheonReviewApps' || $github === 'PantheonReviewAppsManual') {
$fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon');
$fs->ensureDirectoryExists('./.github/workflows');
$fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon');
$is_manual = $github === 'PantheonReviewAppsManual' ? 'Manual' : '';
if (file_exists('./.ddev/config.yaml')) {
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEV.yml", './.github/workflows/PantheonReviewApps.yml');
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEV$is_manual.yml", './.github/workflows/PantheonReviewApps.yml');
}
else {
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps.yml", './.github/workflows/PantheonReviewApps.yml');
}
}
else if ($github === 'PantheonReviewAppsManual') {
$fs->ensureDirectoryExists('./.github/actions/drainpipe/pantheon');
$fs->ensureDirectoryExists('./.github/workflows');
$fs->copy("$scaffoldPath/github/actions/pantheon", './.github/actions/drainpipe/pantheon');
if (file_exists('./.ddev/config.yaml')) {
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsDDEVManual.yml", './.github/workflows/PantheonReviewApps.yml');
}
else {
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewAppsManual.yml", './.github/workflows/PantheonReviewApps.yml');
$fs->copy("$scaffoldPath/github/workflows/PantheonReviewApps$is_manual.yml", './.github/workflows/PantheonReviewApps.yml');
}
}
else if ($github === 'ComposerLockDiff') {
Expand Down

0 comments on commit 778a0a0

Please sign in to comment.