Skip to content

Commit

Permalink
Merge pull request #512 from cakephp/dereuromark-patch-2
Browse files Browse the repository at this point in the history
Only create dirs in debug mode
  • Loading branch information
markstory authored Sep 27, 2021
2 parents 8ce8de7 + 0b108e2 commit f2fbf85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ConfigurationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
namespace Migrations;

use Cake\Core\Configure;
use Cake\Datasource\ConnectionManager;
use Migrations\Util\UtilTrait;
use Phinx\Config\Config;
Expand Down Expand Up @@ -78,11 +79,11 @@ public function getConfig($forceRefresh = false)
$seedsPath = $this->getOperationsPath($this->input(), 'Seeds');
$plugin = $this->getPlugin($this->input());

if (!is_dir($migrationsPath)) {
if (Configure::read('debug') && !is_dir($migrationsPath)) {
mkdir($migrationsPath, 0777, true);
}

if (!is_dir($seedsPath)) {
if (Configure::read('debug') && !is_dir($seedsPath)) {
mkdir($seedsPath, 0777, true);
}

Expand Down

0 comments on commit f2fbf85

Please sign in to comment.