Last active
January 8, 2016 09:56
-
-
Save szeidler/6aa3630e82b23b196a05 to your computer and use it in GitHub Desktop.
drushrc.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Define module download destination. | |
$site_path = drush_site_path(); | |
$site_path_parts = explode('/', $site_path); | |
$clean_site_path_parts = array_slice($site_path_parts, -2, 2); | |
$clean_site_path = implode('/', $clean_site_path_parts); | |
if (!empty($clean_site_path)) { | |
$command_specific['dl']['destination'] = $clean_site_path . '/modules/contrib'; | |
} | |
// Get the site absolute filepath. Extracted from drush_site_path(). | |
function drush_get_absolute_site_path($path = NULL) { | |
$site_path = FALSE; | |
$path = empty($path) ? drush_cwd() : $path; | |
if (file_exists($path . '/settings.php')) { | |
$site_path = $path; | |
} | |
else { | |
while (($path = _drush_shift_path_up($path)) && !drush_valid_root($path)) { | |
if (file_exists($path . '/settings.php')) { | |
$site_path = $path; | |
break; | |
} | |
} | |
} | |
return $site_path; | |
} | |
$patch_path = drush_get_absolute_site_path() . '/modules/patches/patches.make'; | |
if (file_exists($patch_path)) { | |
$options['patch-file'] = $patch_path; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment