Skip to content

Commit

Permalink
#70: Fix --no-interaction for VersionCommand (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmillucci authored and patrickbrouwers committed May 30, 2018
1 parent 0b983fa commit 999f4ce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Console/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ public function handle(ConfigurationProvider $provider)

$this->markMigrated = (boolean) $this->option('add');

$question = 'WARNING! You are about to add, delete or synchronize migration versions from the version table that could result in data lost. Are you sure you wish to continue? (y/n)';
if ($this->confirm($question)) {
$this->markVersions();
if ($this->input->isInteractive()) {
$question = 'WARNING! You are about to add, delete or synchronize migration versions from the version table that could result in data lost. Are you sure you wish to continue? (y/n)';
if ($this->confirm($question)) {
$this->markVersions();
} else {
$this->error('Migration cancelled!');
}
} else {
$this->error('Migration cancelled!');
$this->markVersions();
}
}

Expand Down

0 comments on commit 999f4ce

Please sign in to comment.