Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/Illuminate/Console/ConfirmableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ public function confirmToProceed($warning = 'Application In Production!', $callb

$shouldConfirm = $callback instanceof Closure ? call_user_func($callback) : $callback;

if ($shouldConfirm) {
if ($this->option('force')) {
return true;
}
if (! $shouldConfirm) {
return true;
}

if ($this->option('force')) {
return true;
}

$this->alert($warning);
$this->alert($warning);

$confirmed = $this->confirm('Do you really wish to run this command?');
$confirmed = $this->confirm('Do you really wish to run this command?');

if (! $confirmed) {
$this->comment('Command Cancelled!');
if (! $confirmed) {
$this->comment('Command Cancelled!');

return false;
}
return false;
}

return true;
Expand Down