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

Commit

Permalink
Merge pull request #7 from wavevision/fix/zip-directory
Browse files Browse the repository at this point in the history
Fix top-level dirname
  • Loading branch information
rozsival authored Jul 1, 2020
2 parents 4627423 + 98b0da4 commit e61f07f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Utils/Zip/ZipArchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ private function addDir(ZipArchiveItem $item, int $depth, array $parents = []):
{
$deep = $depth > self::INITIAL_DEPTH;
$dir = $item->getName();
if ($deep) {
$parents = [...$parents, $dir];
$this->zip->addEmptyDir(Path::join(...$parents));
}
$parents = [...$parents, $dir];
$this->zip->addEmptyDir($deep ? Path::join(...$parents) : $dir);
/** @var SplFileInfo $subItem */
foreach (Finder::find('*')->in($item->getPath()) as $subItem) {
$path = $subItem->getPathname();
Expand Down

0 comments on commit e61f07f

Please sign in to comment.