Permalink
Browse files

Make sure top-level files are also merged

  • Loading branch information...
hanoii committed Jun 22, 2015
1 parent 98809b0 commit d10826132d72f8dabc10a396efe43319d4a5b316
Showing with 8 additions and 3 deletions.
  1. +8 −3 commands/make/make.drush.inc
@@ -670,10 +670,15 @@ function make_move_build($build_path) {
// To prevent the removal of top-level directories such as 'modules' or
// 'themes', descend in a level if the file exists.
// TODO: This only protects one level of directories from being removed.
$files = drush_scan_directory($file->filename, '/./', array('.', '..'), 0, FALSE);
$overwrite = drush_get_option('overwrite', FALSE) ? FILE_EXISTS_OVERWRITE : FILE_EXISTS_MERGE;
foreach ($files as $file) {
$ret = $ret && drush_copy_dir($file->filename, $destination . DIRECTORY_SEPARATOR . $file->basename, $overwrite);
if (is_dir($destination)) {
$files = drush_scan_directory($file->filename, '/./', array('.', '..'), 0, FALSE);
foreach ($files as $file) {
$ret = $ret && drush_copy_dir($file->filename, $destination . DIRECTORY_SEPARATOR . $file->basename, $overwrite);
}
}
else {
$ret = $ret && drush_copy_dir($file->filename, $destination, $overwrite);
}
}
else {

0 comments on commit d108261

Please sign in to comment.