Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use new Drupal Finder (Composer Runtime) API #650

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"drupal/core-recommended": "^10.2.0",
"drush/drush": "^12.4.3",
"vlucas/phpdotenv": "^5.1",
"webflo/drupal-finder": "^1.2"
"webflo/drupal-finder": "^1.3"
},
"require-dev": {
"drupal/core-dev": "^10.2.0",
Expand Down
14 changes: 11 additions & 3 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@
use Composer\Semver\Comparator;
use Drupal\Core\Site\Settings;
use Drupal\Core\Site\SettingsEditor;
use DrupalFinder\DrupalFinder;
use DrupalFinder\DrupalFinderComposerRuntime;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Path;

class ScriptHandler {

public static function createRequiredFiles(Event $event) {
$fs = new Filesystem();
$drupalFinder = new DrupalFinder();
$drupalFinder->locateRoot(getcwd());
$drupalFinder = new DrupalFinderComposerRuntime();
$drupalRoot = $drupalFinder->getDrupalRoot();

// If Drupal root was not found, exit.
if (is_null($drupalRoot)) {
$io = $event->getIO();
$io->writeError(
'<error>Drupal root could not be detected.</error>',
);
exit(1);
}

$dirs = [
'modules',
'profiles',
Expand Down
Loading