Skip to content

Commit 473a17b

Browse files
committed
Merge branch 'master' of git://github.com/pattern-lab/patternlab-php-core
2 parents 9ba962e + 4d1ebe5 commit 473a17b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/PatternLab/Fetch.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function fetchStarterKit($starterkit = "") {
5757

5858
// set default attributes
5959
$sourceDir = Config::getOption("sourceDir");
60-
$tempDir = sys_get_temp_dir();
60+
$tempDir = sys_get_temp_dir().DIRECTORY_SEPARATOR."pl-sk";
6161
$tempDirSK = $tempDir.DIRECTORY_SEPARATOR."pl-sk-archive";
6262
$tempDirDist = $tempDirSK.DIRECTORY_SEPARATOR."dist";
6363
$tempComposerFile = $tempDirSK.DIRECTORY_SEPARATOR."composer.json";
@@ -75,6 +75,14 @@ public function fetchStarterKit($starterkit = "") {
7575
$error = error_get_last();
7676
Console::writeError("the starterkit wasn't downloaded because:\n\n ".$error["message"]);
7777
}
78+
79+
// Create temp directory if doesn't exist
80+
$fs = new Filesystem();
81+
try {
82+
$fs->mkdir($tempDir, 0775);
83+
} catch (IOExceptionInterface $e) {
84+
Console::writeError("Error creating temporary directory at " . $e->getPath());
85+
}
7886

7987
// write the package to the temp directory
8088
$tempFile = tempnam($tempDir, "pl-sk-archive.tar.gz");

0 commit comments

Comments
 (0)