function HgDownloader::doInstall
@inheritDoc
Overrides VcsDownloader::doInstall
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ HgDownloader.php, line 40
Class
- HgDownloader
- @author Per Bernhardt <plb@webfactory.de>
Namespace
Composer\DownloaderCode
protected function doInstall(PackageInterface $package, string $path, string $url) : PromiseInterface {
$hgUtils = new HgUtils($this->io, $this->config, $this->process);
$cloneCommand = static function (string $url) use ($path) : array {
return [
'hg',
'clone',
'--',
$url,
$path,
];
};
$hgUtils->runCommand($cloneCommand, $url, $path);
$command = [
'hg',
'up',
'--',
(string) $package->getSourceReference(),
];
if (0 !== $this->process
->execute($command, $ignoredOutput, realpath($path))) {
throw new \RuntimeException('Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process
->getErrorOutput());
}
return \React\Promise\resolve(null);
}