Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HgDownloader.php

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\Downloader

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal