Skip to content

Commit d4239e8

Browse files
committed
Create sub-directories in the correct method
1 parent ae52a12 commit d4239e8

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

composer/repository.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public function prepare_build_dir($force)
6464
}
6565
$this->fs->mkdir($this->build_dir);
6666

67+
// Create filtered repository subdirectories
68+
$branches = ext::get_filtered_repository_branches();
69+
foreach ($branches as $branch)
70+
{
71+
$this->fs->mkdir($this->build_dir . $branch);
72+
}
73+
6774
return $this;
6875
}
6976

@@ -166,10 +173,6 @@ public function dump_include($name, array $packages, $subdir = '')
166173
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
167174
);
168175
$target_dir = $this->build_dir . $subdir;
169-
if ($subdir && !$this->fs->exists($target_dir))
170-
{
171-
$this->fs->mkdir($target_dir);
172-
}
173176
$file = $target_dir . $name;
174177
$this->fs->dumpFile($file, $packages);
175178
}
@@ -215,11 +218,6 @@ protected function build_parent_structure($subdir = '')
215218
$includes = $this->get_include_files();
216219
$parent = $types = array();
217220
$target_dir = $this->build_dir . $subdir;
218-
219-
if ($subdir && !$this->fs->exists($target_dir))
220-
{
221-
$this->fs->mkdir($target_dir);
222-
}
223221

224222
foreach ($includes as $file)
225223
{

0 commit comments

Comments
 (0)