Skip to content

Commit

Permalink
fix: zip support
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Mar 26, 2024
1 parent 70b85b6 commit 0ca609d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Support/Zip.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ public function ensureDoesntHaveSubdir(string $targetPath): string
$files[] = $file;
}

foreach ($files as $file) {
if (str_contains($file, 'plugin.json') || str_contains($file, 'theme.json')) {
return $targetPath;
}
}

$fileCount = count($files);
if (1 < $fileCount && $fileCount <= 3) {
throw new \RuntimeException("Cannot handle the zip file, zip file count is: {$fileCount}, extract path is: {$targetPath}");
Expand Down

0 comments on commit 0ca609d

Please sign in to comment.