Skip to content

Commit 6276139

Browse files
authored
Merge pull request #169 from Ravetracer/master
Updated condition to prevent error on existing dir
2 parents 590e3ac + 5e21583 commit 6276139

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Command/DoctrineCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function configureMigrations(ContainerInterface $container, Config
3232
{
3333
if (!$configuration->getMigrationsDirectory()) {
3434
$dir = $container->getParameter('doctrine_migrations.dir_name');
35-
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
35+
if (!is_dir($dir) && !@mkdir($dir, 0777, true) && !is_dir($dir)) {
3636
$error = error_get_last();
3737
throw new \ErrorException($error['message']);
3838
}
@@ -46,7 +46,7 @@ public static function configureMigrations(ContainerInterface $container, Config
4646
$dir = str_replace('%'.$pathPlaceholder.'%', $container->getParameter($pathPlaceholder), $dir);
4747
}
4848
}
49-
if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
49+
if (!is_dir($dir) && !@mkdir($dir, 0777, true) && !is_dir($dir)) {
5050
$error = error_get_last();
5151
throw new \ErrorException($error['message']);
5252
}

0 commit comments

Comments
 (0)