Show warning if the svn binary is missing

main
Jordi Boggiano 12 years ago
parent c7a13893c7
commit 4998bab944

@ -270,6 +270,10 @@ class SvnDriver extends VcsDriver
try {
return $this->util->execute($command, $url);
} catch (\RuntimeException $e) {
if (0 !== $this->process->execute('svn --version', $ignoredOutput)) {
throw new \RuntimeException('Failed to load '.$this->url.', svn was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput());
}
throw new \RuntimeException(
'Repository '.$this->url.' could not be processed, '.$e->getMessage()
);

@ -32,12 +32,15 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
$output .= " rejected Basic challenge (http://corp.svn.local/)";
$process = $this->getMock('Composer\Util\ProcessExecutor');
$process->expects($this->once())
$process->expects($this->at(1))
->method('execute')
->will($this->returnValue(1));
$process->expects($this->once())
->method('getErrorOutput')
->will($this->returnValue($output));
$process->expects($this->at(2))
->method('execute')
->will($this->returnValue(0));
$config = new Config();
$config->merge(array(

Loading…
Cancel
Save