Skip to content

Commit

Permalink
#4632 check to see if we are using semantic versioning before decidin… (
Browse files Browse the repository at this point in the history
#4633)

* #4632 check to see if we are using semantic versioning before deciding that we are not using info.yml files

* #4632 reduced and improved the determination rules to a regular expression
  • Loading branch information
jrglasgow committed Jan 17, 2021
1 parent d229d6e commit 399927f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/pm/pm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,8 @@ function drush_find_empty_directories($dir, $exclude = array()) {
function drush_pm_inject_info_file_metadata($project_dir, $project_name, $version, $datestamp) {
// `drush_drupal_major_version()` cannot be used here because this may be running
// outside of a Drupal context.
$yaml_format = substr($version, 0, 1) >= 8;
$regex = '/((\d*)\.\d*\.[\dx]*-?.*)|([89]\.x-\d*\.[\dx]*.*)/';
$yaml_format = preg_match($regex, $version);
$pattern = preg_quote($yaml_format ? '.info.yml' : '.info');
$info_files = drush_scan_directory($project_dir, '/.*' . $pattern . '$/');
if (!empty($info_files)) {
Expand Down

0 comments on commit 399927f

Please sign in to comment.