Skip to content

Commit

Permalink
Merge pull request #31 from City-of-Helsinki/UHF-X-update-composer-mi…
Browse files Browse the repository at this point in the history
…gration

Update composer
  • Loading branch information
hyrsky authored Jun 12, 2024
2 parents 9b33c80 + b579d2f commit cea6929
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 cea6929

Please sign in to comment.