Skip to content

Commit

Permalink
UHF-11184: Remove druidfi/tools
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Dec 17, 2024
1 parent 2eb037b commit c579748
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 36 deletions.
44 changes: 8 additions & 36 deletions src/Drush/Commands/UpdateDrushCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,41 +126,11 @@ private function parseOptions(array $options, string $root) : UpdateOptions {
return new UpdateOptions(
ignoreFiles: $ignoreFiles,
branch: $options['branch'],
updateExternalPackages: $options['update-external-packages'],
selfUpdate: $options['self-update'],
runMigrations: $options['run-migrations'],
);
}

/**
* Updates the dependencies.
*
* @param \DrupalTools\Update\UpdateOptions $options
* The update options.
* @param string $root
* The root directory.
*
* @return self
* The self.
*/
private function updateExternalPackages(UpdateOptions $options, string $root) : self {
if (!$options->updateExternalPackages) {
return $this;
}
$this->style->note('Checking external packages ...');

// Update druidfi/tools only if the package exists.
if ($this->filesystem->exists($root . '/tools')) {
$this->processManager()->process([
'make',
'self-update',
])->run(function (string $type, ?string $output) : void {
$this->style->write($output);
});
}
return $this;
}

/**
* Checks if the self-package needs to be updated.
*
Expand Down Expand Up @@ -257,11 +227,13 @@ private function updateDefaultFiles(UpdateOptions $options) : self {
'phpcs.xml.dist',
'phpunit.xml.dist',
'phpunit.platform.xml',
'tools/make/override.mk',
'tools/make/project/install.mk',
'tools/make/project/git.mk',
'tools/make/project/theme.mk',
'tools/make/project/db-sync.sh',
'Makefile',
'tools/make/composer.mk',
'tools/make/docker.mk',
'tools/make/drupal.mk',
'tools/make/git.mk',
'tools/make/qa.mk',
'tools/make/theme.mk',
'tools/commit-msg',
'.sonarcloud.properties',
'.github/pull_request_template.md',
Expand Down Expand Up @@ -325,7 +297,7 @@ public function updatePlatform(array $options = self::DEFAULT_OPTIONS) : int {

return DrushCommands::EXIT_FAILURE_WITH_CLARITY;
}
$this->updateExternalPackages($options, $root)
$this
->runUpdateHooks($options, $root)
->updateDefaultFiles($options)
->addDefaultFiles($options);
Expand Down
9 changes: 9 additions & 0 deletions src/Update/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,12 @@ function drupal_tools_update_14() : UpdateResult {
'Added phpstan/extension-installer to allow-plugins',
]);
}

/**
* Remove druidfi/tools.
*/
function drupal_tools_update_15(UpdateOptions $options, FileManager $fileManager): UpdateResult {
$fileManager->removeFiles($options, [

Check failure on line 295 in src/Update/migrations.php

View workflow job for this annotation

GitHub Actions / tests (8.1)

Function DrupalTools\Update\drupal_tools_update_15() should return DrupalTools\Update\UpdateResult but return statement is missing.

Check failure on line 295 in src/Update/migrations.php

View workflow job for this annotation

GitHub Actions / tests (8.2)

Function DrupalTools\Update\drupal_tools_update_15() should return DrupalTools\Update\UpdateResult but return statement is missing.
'tools',
]);
}

0 comments on commit c579748

Please sign in to comment.