function _drush_generate_makefile_check_path

8.0.x generate.make.inc _drush_generate_makefile_check_path($project)
6.x generate.make.inc _drush_generate_makefile_check_path($project)
7.x generate.make.inc _drush_generate_makefile_check_path($project)
5.x generate.make.inc _drush_generate_makefile_check_path($project)
master generate.make.inc _drush_generate_makefile_check_path($project)

Helper function to check for a non-default installation location.

1 call to _drush_generate_makefile_check_path()
_drush_make_generate_projects in commands/make/generate.make.inc
Generate the $projects makefile array for the current site.

File

commands/make/generate.make.inc, line 294
Functions for the generate makefile command.

Code

function _drush_generate_makefile_check_path($project) {
  $info = array();
  $type = $project['type'];
  $path = dirname($project['path']);
  // Check to see if the path is in a subdir sites/all/modules or
  // profiles/profilename/modules
  if (preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path) || preg_match('@^sites/[a-zA-Z0-9_]*/' . $type . 's/..*@', $path)) {
    $subdir = preg_replace(array('@^[a-zA-Z0-9_]*/[a-zA-Z0-9_]*/' . $type . 's/*@', "@/$name" . '$@'), '', $path);
    if (!empty($subdir)) {
      $info['subdir'] = $subdir;
    }
  }
  return $info;
}