Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from tienvx/gzip-override
Browse files Browse the repository at this point in the history
Gzip override
  • Loading branch information
tienvx authored Dec 5, 2022
2 parents 11b842d + da68751 commit 61dd908
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/tests export-ignore
/.github export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
vendor
composer.lock
.phpunit.result.cache
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/GzipHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function download(Composer $composer, IOInterface $io): void
{
parent::download($composer, $io);
// Target file is still gzip file, need to be decompressed.
$command = 'gzip -d '.ProcessExecutor::escape($this->getTargetFilePath());
$command = 'gzip -df '.ProcessExecutor::escape($this->getTargetFilePath());
if (0 !== $this->process->execute($command)) {
$processError = 'Failed to execute '.$command."\n\n".$this->process->getErrorOutput();
throw new \RuntimeException($processError);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Handler/GzipHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ protected function assertDownload(bool $hasException = false): void
{
parent::assertDownload();
$command = \PHP_OS_FAMILY === 'Windows'
? "gzip -d {$this->getTargetFilePath()}"
: "gzip -d '{$this->getTargetFilePath()}'";
? "gzip -df {$this->getTargetFilePath()}"
: "gzip -df '{$this->getTargetFilePath()}'";
$this->process
->expects($this->once())
->method('execute')
Expand Down

0 comments on commit 61dd908

Please sign in to comment.