Skip to content

Commit 726dfdd

Browse files
authored
Merge pull request #34 from mreiden/mreiden-patch-1
Avoid a file exists error instead of supressing it
2 parents 2bdf379 + 57a0458 commit 726dfdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ public function extract($outdir, $strip = '', $exclude = '', $include = '')
166166
// create output directory
167167
$output = $outdir.'/'.$fileinfo->getPath();
168168
$directory = ($fileinfo->getIsdir()) ? $output : dirname($output);
169-
@mkdir($directory, 0777, true);
169+
if (!file_exists($directory)) {
170+
mkdir($directory, 0777, true);
171+
}
170172

171173
// extract data
172174
if (!$fileinfo->getIsdir()) {

0 commit comments

Comments
 (0)