Skip to content

Commit 255ee12

Browse files
committed
catching the zippy failure
1 parent 2dd0d83 commit 255ee12

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/PatternLab/Fetch.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ public function fetchStarterKit($starterkit = "") {
9696
}
9797

9898
// extract, if the zip is supposed to be unpacked do that (e.g. stripdir)
99-
$zippy = Zippy::load();
100-
$zippy->addStrategy(new UnpackFileStrategy());
101-
$zippy->getAdapterFor('tar.gz')->open($tempFile)->extract($tempDirSK);
102-
99+
try {
100+
$zippy = Zippy::load();
101+
$zippy->addStrategy(new UnpackFileStrategy());
102+
$zippy->getAdapterFor('tar.gz')->open($tempFile)->extract($tempDirSK);
103+
} catch(\RuntimeException $e) {
104+
Console::writeError("failed to extract the starterkit. easiest solution is to manually download it and copy <path>./dist</path to <path>./source/</path>...");
105+
}
106+
103107
if (!is_dir($tempDirDist)) {
104108
// try without repo dir
105109
$tempDirDist = $tempDirSK.DIRECTORY_SEPARATOR."dist";

0 commit comments

Comments
 (0)