Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from oechsler-wunder/master
Browse files Browse the repository at this point in the history
Add option to run drush in a certain directory.
  • Loading branch information
guncha25 authored May 31, 2017
2 parents b334aed + 8dce855 commit a6e1d60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ modules:
config:
PhpBrowser:
url: 'http://localhost/myapp/'
DrupalDrush:
working_directory: '/path/to/webroot'

```
The option `working_directory` may be ommited, it defaults to the current directory.
5 changes: 5 additions & 0 deletions src/DrupalDrush.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public function getDrush($command, array $arguments, $options = array(), $drush
$command_args = array_merge($args, $arguments);
$processBuilder = new ProcessBuilder($command_args);

// Set working directory if configured.
if ($pwd = $this->_getConfig('working_directory')) {
$processBuilder->setWorkingDirectory($pwd);
}

foreach ($options as $option) {
$processBuilder->add($option);
}
Expand Down

0 comments on commit a6e1d60

Please sign in to comment.