function drushScriptCase::createDrushWrapper

8.0.x drushScriptTest.php drushScriptCase::createDrushWrapper($drush_base)
master drushScriptTest.php drushScriptCase::createDrushWrapper($drush_base)

TODO: Create a Drush wrapper script, and copy it to to the root of the fake Drupal site, and point it at the specified site-local Drush script.

1 call to drushScriptCase::createDrushWrapper()

File

tests/drushScriptTest.php, line 121

Namespace

Unish

Class

drushScriptCase
Tests for the 'drush' script itself

Code

function createDrushWrapper($drush_base) {
  $drush_launcher = $drush_base . '/drush/drush/drush.launcher';

  $drush_wrapper_src = dirname(UNISH_DRUSH) . '/examples/drush.wrapper';
  $drush_wrapper_contents = file_get_contents($drush_wrapper_src);
  $drush_wrapper_contents = preg_replace('#\.\./vendor/bin/drush.launcher#', $drush_launcher, $drush_wrapper_contents);
  $drush_wrapper_target = $this->webroot() . '/drush.wrapper';

  file_put_contents($drush_wrapper_target, $drush_wrapper_contents);
  @chmod($drush_wrapper_target, 0777);
}