forked from drush-ops/drush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsut
executable file
·31 lines (28 loc) · 905 Bytes
/
sut
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
#!/usr/bin/env php
<?php
/**
* Run a Drush command against the Site Under Test
*
* @usage sut core-status --verbose
*/
require __DIR__. '/tests/unish.inc';
list($unish_tmp, $unish_sandbox, $unish_drush_dir) = unishGetPaths();
$sut = dirname($unish_sandbox) . '/drush-sut';
$vendor = $sut . '/vendor';
// Get the arguments for the command.
$arguments = $GLOBALS['argv'];
// Shift off argv[0] which contains the name of this script.
array_shift($arguments);
// Add uri option
array_unshift($arguments, "--uri=dev");
/**
* DRUSH_AUTOLOAD_PHP must be provided because Drush is symlinked into the SUT.
* This confuses our autoload.php detection.
*/
$cmd = "DRUSH_AUTOLOAD_PHP=$vendor/autoload.php " . escapeshellarg($vendor . '/bin/drush') . ' ' . implode(' ', $arguments);
if (unishIsVerbose()) {
fwrite(STDERR, 'Executing: ' . $cmd . "\n");
}
chdir($sut);
passthru($cmd, $return);
exit($return);