function drush_pm_relocate_project

3.x drush_pm_relocate_project(&$project, $release)

drush_pm_relocate_project moves projects that should be relocated to a different installation directory to the location they belong in. For example, modules that are only collections of drush commands will be installed to $HOME/.drush.

This function is called after the project is downloaded so that its contents can be examined to determine its optimal installation location. Every drush commandfile is given a chance to examine the project contents and decide where the project should be located.

1 call to drush_pm_relocate_project()
drush_pm_download in commands/pm/
Command callback. Download Drupal core or any project.


commands/pm/, line 1422
The drush Package Manager


function drush_pm_relocate_project(&$project, $release) {
  // Call the get-install-location hook to see if any drush commandfiles
  // would like to adjust the install location for this project.
  // drush_command_invoke_all() allows the first parameter to be passed by reference.
  drush_command_invoke_all_ref('drush_pm_adjust_download_destination', $project, $release);

  if (isset($project['project_install_location']) && ($project['full_project_path'] != $project['project_install_location'])) {
    if (drush_move_dir($project['full_project_path'], $project['project_install_location'], TRUE)) {
      $project['full_project_path'] = $project['project_install_location'];
    else {
      drush_log(dt("Project !project (!version) could not be relocated to !dest.", array('!project' => $project['name'], '!version' => $release['version'], '!dest' => $project['project_install_location'])), 'warning');
  return TRUE;