Skip to content

Commit 999f4ce

Browse files
lmilluccipatrickbrouwers
authored andcommitted
#70: Fix --no-interaction for VersionCommand (#71)
1 parent 0b983fa commit 999f4ce

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Console/VersionCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ public function handle(ConfigurationProvider $provider)
5454

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

57-
$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)';
58-
if ($this->confirm($question)) {
59-
$this->markVersions();
57+
if ($this->input->isInteractive()) {
58+
$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)';
59+
if ($this->confirm($question)) {
60+
$this->markVersions();
61+
} else {
62+
$this->error('Migration cancelled!');
63+
}
6064
} else {
61-
$this->error('Migration cancelled!');
65+
$this->markVersions();
6266
}
6367
}
6468

0 commit comments

Comments
 (0)