function XzDownloader::extract
Overrides ArchiveDownloader::extract
File
-
vendor/
composer/ composer/ src/ Composer/ Downloader/ XzDownloader.php, line 27
Class
- XzDownloader
- Xz archive downloader.
Namespace
Composer\DownloaderCode
protected function extract(PackageInterface $package, string $file, string $path) : PromiseInterface {
$command = [
'tar',
'-xJf',
$file,
'-C',
$path,
];
if (0 === $this->process
->execute($command, $ignoredOutput)) {
return \React\Promise\resolve(null);
}
$processError = 'Failed to execute ' . implode(' ', $command) . "\n\n" . $this->process
->getErrorOutput();
throw new \RuntimeException($processError);
}