Skip to content
Snippets Groups Projects
Commit 3af03b46 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Issue #3476486: Parse composer release type during packaging

parent 7bc1fc7c
Branches
No related tags found
2 merge requests!312Issue # 3494493: Documentation: Document Maintainer Widget,!299Remove heroes from components field. Update CTA section and add variants.
......@@ -286,13 +286,27 @@ class DrupalorgProjectPackageRelease implements ProjectReleasePackagerInterface
}
$files[$this->filenames['path_zip']] = 1;
// Check for a composer.json file.
try {
if (file_exists($this->export . '/composer.json') && ($composer_json = json_decode(file_get_contents($this->export . '/composer.json')))) {
if (!empty($composer_json->type)) {
$this->release_node_wrapper->field_composer_type = $composer_json->type;
}
}
}
catch (Exception $e) {
watchdog('package_error', 'Exception in composer.json parsing while processing @id: @message', [
'@id' => $this->project_short_name,
'@message' => $e->getMessage(),
], WATCHDOG_NOTICE);
}
// We must remove the link before Drush runs drush_delete_dir_contents.
// Drush cleanup will briefly set all files to 777, including the file
// LICENSE.txt is linked to. Remove when
// https://github.com/drush-ops/drush/issues/672 is fixed.
@unlink($this->export . '/LICENSE.txt');
// Clean up the clone because drush_delete_tmp_dir() is slow, and disk use
// can pile up as multiple releases are packaged.
drush_shell_exec('rm -rf %s', $this->git_checkout_dir);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment