Skip to content

Commit

Permalink
Fix #2318. Set cwd when Finder is launching via proc_open().
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Aug 25, 2016
1 parent 2b2bfb6 commit b5aa6bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/startup.inc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function _drush_escapeshellarg_windows($arg, $raw = FALSE) {
function drush_startup($argv) {
$sep = DIRECTORY_SEPARATOR;
$found_script = "";
$cwd = getcwd();
$home = getenv("HOME");
$use_dir = "$home{$sep}.drush{$sep}use";

Expand Down Expand Up @@ -427,7 +428,7 @@ function drush_startup($argv) {
// @see https://bugs.php.net/bug.php?id=60181
$cmd = '"'. $cmd. '"';
}
$process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes);
$process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes, $cwd);
$proc_status = proc_get_status($process);
$exit_code = proc_close($process);
exit($proc_status["running"] ? $exit_code : $proc_status["exitcode"] );
Expand Down

0 comments on commit b5aa6bf

Please sign in to comment.