Skip to content

Commit

Permalink
Set the CommandExecutor buildPath property when a build is created.
Browse files Browse the repository at this point in the history
Closes #556
  • Loading branch information
nonlux authored and Dan Cryer committed Feb 23, 2015
1 parent 4905679 commit 893dead
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions PHPCI/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ protected function setupBuild()
PHPCI_URL
);

$this->commandExecutor->setBuildPath($this->buildPath);

// Create a working copy of the project:
if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
throw new \Exception(Lang::get('could_not_create_working'));
Expand Down
13 changes: 10 additions & 3 deletions PHPCI/Helper/BaseCommandExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ public function __construct(BuildLogger $logger, $rootDir, &$quiet = false, &$ve
$this->logger = $logger;
$this->quiet = $quiet;
$this->verbose = $verbose;

$this->lastOutput = array();

$this->rootDir = $rootDir;
}

Expand Down Expand Up @@ -92,7 +90,7 @@ public function executeCommand($args = array())

$pipes = array();

$process = proc_open($command, $descriptorSpec, $pipes, dirname($this->buildPath), null);
$process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null);

if (is_resource($process)) {
fclose($pipes[0]);
Expand Down Expand Up @@ -219,4 +217,13 @@ public function getComposerBinDir($path)
}
return null;
}

/**
* Set the buildPath property.
* @param string $path
*/
public function setBuildPath($path)
{
$this->buildPath = $path;
}
}
6 changes: 6 additions & 0 deletions PHPCI/Helper/CommandExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ public function getLastOutput();
* @return null|string
*/
public function findBinary($binary, $buildPath = null);

/**
* Set the buildPath property.
* @param string $path
*/
public function setBuildPath($path);
}

0 comments on commit 893dead

Please sign in to comment.