forked from helior/make_local
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_local.drush.inc
31 lines (25 loc) · 900 Bytes
/
make_local.drush.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* Custom drush make download mechanism for sourcing local directories.
*/
function make_download_local($name, $type, $download, $download_location) {
$path = $download['source'];
if (is_dir($path) || is_file($path)) {
drush_log(dt('@project found in @url.', array('@project' => $name, '@url' => $path)), 'ok');
return drush_copy_dir($path, $download_location, FILE_EXISTS_OVERWRITE);
}
return drush_set_error('DRUSH_BAD_PATH', dt('Could not evaluate source path !path.', array('!path' => $path)));
}
/**
* Custom project type handling.
*/
class DrushMakeProject_Local extends DrushMakeProject_Library {
/**
* Override contructor so that projects can decide where they belong
* using 'subdir', relative to the Drupal root.
*/
protected function __construct(&$project) {
parent::__construct($project);
$this->contrib_destination = '';
}
}