Skip to content

Commit

Permalink
Update composer
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Jun 12, 2024
1 parent 9b33c80 commit b579d2f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Update/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,24 @@ function drupal_tools_update_6(UpdateOptions $options, FileManager $fileManager)
]);
return new UpdateResult(['Attempted to remove docker-compose.yml file.']);
}

/**
* Update composer/composer.
*/
function drupal_tools_update_7() : UpdateResult {
$command = ['composer', 'show', 'composer/composer'];

$process = new Process($command);
$process->run();

if (!$process->isSuccessful()) {
return new UpdateResult(['composer/composer is not installed. Skipping ...']);
}

$command = ['composer', 'update', 'composer/composer:2.7.7', '-W'];

$process = new Process($command);
$process->mustRun();

return new UpdateResult(['Updated composer/composer.']);
}

0 comments on commit b579d2f

Please sign in to comment.