Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 17347f7

Browse files
committed
Fix extracting to directory
1 parent 70c10ba commit 17347f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Downloader/PharResult.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function extract(string $file, string $target): self
4949
/** @var \PharFileInfo $info */
5050
$info = $this->phar[$file];
5151

52+
if (!\is_dir($directory = \dirname($target))) {
53+
\mkdir($directory, recursive: true);
54+
}
55+
5256
\file_put_contents($target, $info->getContent());
5357

5458
return $this;

0 commit comments

Comments
 (0)