Skip to content

Commit

Permalink
Don't try to create a directory that already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
prinsfrank authored and ondrejmirtes committed Jul 7, 2021
1 parent c98d0a4 commit 2a1597b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static function begin(
);

$createDir = static function (string $path) use ($errorOutput): void {
if (!@mkdir($path, 0777) && !is_dir($path)) {
if (!is_dir($path) && !@mkdir($path, 0777) && !is_dir($path)) {
$errorOutput->writeLineFormatted(sprintf('Cannot create a temp directory %s', $path));
throw new \PHPStan\Command\InceptionNotSuccessfulException();
}
Expand Down

0 comments on commit 2a1597b

Please sign in to comment.