function _drush_generate_validate_repo_location

8.0.x generate.make.inc _drush_generate_validate_repo_location($repo_root)
6.x generate.make.inc _drush_generate_validate_repo_location($repo_root)
7.x generate.make.inc _drush_generate_validate_repo_location($repo_root)
5.x generate.make.inc _drush_generate_validate_repo_location($repo_root)
master generate.make.inc _drush_generate_validate_repo_location($repo_root)

If the user has checked in the Drupal root, or the 'sites/all/modules' folder into a git repository, then we do not want to confuse that location with a "project".

1 call to _drush_generate_validate_repo_location()
_drush_generate_custom_project in commands/make/generate.make.inc
Create a project record for an extension not downloaded from drupal.org

File

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

Code

function _drush_generate_validate_repo_location($repo_root) {
  $project_name = basename($repo_root);
  // The Drupal root, or any folder immediately inside the Drupal
  // root cannot be a project location.
  if ((strlen(DRUPAL_ROOT) >= strlen($repo_root)) || (dirname($repo_root) == DRUPAL_ROOT)) {
    return NULL;
  }
  // Also exclude sites/* and sites/*/{modules,themes} and profile/* and
  // profile/*/{modules,themes}.
  return $project_name;
}