function DrushMakeProject::findDownloadLocation

8.0.x make.project.inc DrushMakeProject::findDownloadLocation()
6.x make.project.inc DrushMakeProject::findDownloadLocation()
7.x make.project.inc DrushMakeProject::findDownloadLocation()
5.x make.project.inc DrushMakeProject::findDownloadLocation()
master make.project.inc DrushMakeProject::findDownloadLocation()

Determine the location to download project to.

1 call to DrushMakeProject::findDownloadLocation()
DrushMakeProject::make in commands/make/make.project.inc
Build a project.
1 method overrides DrushMakeProject::findDownloadLocation()
DrushMakeProject_Core::findDownloadLocation in commands/make/make.project.inc
Determine the location to download project to.

File

commands/make/make.project.inc, line 195
Drush Make processing classes.

Class

DrushMakeProject
The base project class.

Code

function findDownloadLocation() {
  $this->path = $this->generatePath();
  $this->project_directory = !empty($this->directory_name) ? $this->directory_name : $this->name;
  $this->download_location = $this->path . '/' . $this->project_directory;
  // This directory shouldn't exist yet -- if it does, stop,
  // unless overwrite has been set to TRUE.
  if (is_dir($this->download_location) && !$this->overwrite) {
    drush_set_error('MAKE_DIRECTORY_EXISTS', dt('Directory not empty: !directory', array('!directory' => $this->download_location)));
    return FALSE;
  }
  elseif ($this->download['type'] === 'pm') {
    // pm-download will create the final contrib directory.
    drush_mkdir(dirname($this->download_location));
  }
  else {
    drush_mkdir($this->download_location);
  }
  return $this->download_location;
}