1
0
Fork 0

Merge pull request #8462 from BR0kEN-/issues/8461

#8461: [ZipDownloader] Print `unzip` exit code when the command is failed
pull/8475/head
Jordi Boggiano 2019-12-07 18:42:26 +01:00 committed by GitHub
commit 295cc8bc90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -105,11 +105,11 @@ class ZipDownloader extends ArchiveDownloader
$command = 'unzip -qq '.$overwrite.' '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path); $command = 'unzip -qq '.$overwrite.' '.ProcessExecutor::escape($file).' -d '.ProcessExecutor::escape($path);
try { try {
if (0 === $this->process->execute($command, $ignoredOutput)) { if (0 === $exitCode = $this->process->execute($command, $ignoredOutput)) {
return true; return true;
} }
$processError = new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); $processError = new \RuntimeException('Failed to execute ('.$exitCode.') '.$command."\n\n".$this->process->getErrorOutput());
} catch (\Exception $e) { } catch (\Exception $e) {
$processError = $e; $processError = $e;
} }

View File

@ -184,7 +184,7 @@ class ZipDownloaderTest extends TestCase
/** /**
* @expectedException \Exception * @expectedException \Exception
* @expectedExceptionMessage Failed to execute unzip * @expectedExceptionMessage Failed to execute (1) unzip
*/ */
public function testSystemUnzipOnlyFailed() public function testSystemUnzipOnlyFailed()
{ {
@ -310,7 +310,7 @@ class ZipDownloaderTest extends TestCase
/** /**
* @expectedException \Exception * @expectedException \Exception
* @expectedExceptionMessage Failed to execute unzip * @expectedExceptionMessage Failed to execute (1) unzip
*/ */
public function testWindowsFallbackFailed() public function testWindowsFallbackFailed()
{ {