Skip to content

Instantly share code, notes, and snippets.

@szeidler
Created May 19, 2017 11:44
Show Gist options
  • Save szeidler/36c26b58f57206c35d0bc5727bbb066a to your computer and use it in GitHub Desktop.
Save szeidler/36c26b58f57206c35d0bc5727bbb066a to your computer and use it in GitHub Desktop.
drushrc.php for Drush Patchfile and Docker4Drupal
<?php
// Get the site absolute filepath. Extracted from drush_site_path().
function drush_get_absolute_site_path() {
$possible_paths = array(
'/var/www/drupal/web/sites/default',
'/var/www/html/web/sites/default',
'/var/www/html/sites/default',
);
foreach ($possible_paths as $path) {
if (file_exists($path)) {
return $path;
}
}
return FALSE;
}
$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