Skip to content

Commit 996b283

Browse files
committed
add whisper option
1 parent 2a37790 commit 996b283

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Illuminate/Console/Scheduling/ScheduleRunCommand.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
class ScheduleRunCommand extends Command
2323
{
2424
/**
25-
* The console command name.
25+
* The name and signature of the console command.
2626
*
2727
* @var string
2828
*/
29-
protected $name = 'schedule:run';
29+
protected $signature = 'schedule:run {--whisper : Do not output message indicating that no jobs were ready to run}';
3030

3131
/**
3232
* The console command description.
@@ -111,8 +111,6 @@ public function handle(Schedule $schedule, Dispatcher $dispatcher, Cache $cache,
111111
$this->handler = $handler;
112112
$this->phpBinary = Application::phpBinary();
113113

114-
$this->newLine();
115-
116114
$events = $this->schedule->dueEvents($this->laravel);
117115

118116
if ($events->contains->isRepeatable()) {
@@ -126,6 +124,10 @@ public function handle(Schedule $schedule, Dispatcher $dispatcher, Cache $cache,
126124
continue;
127125
}
128126

127+
if (! $this->eventsRan) {
128+
$this->newLine();
129+
}
130+
129131
if ($event->onOneServer) {
130132
$this->runSingleServerEvent($event);
131133
} else {
@@ -140,7 +142,9 @@ public function handle(Schedule $schedule, Dispatcher $dispatcher, Cache $cache,
140142
}
141143

142144
if (! $this->eventsRan) {
143-
$this->components->info('No scheduled commands are ready to run.');
145+
if (! $this->option('whisper')) {
146+
$this->components->info('No scheduled commands are ready to run.');
147+
}
144148
} else {
145149
$this->newLine();
146150
}

0 commit comments

Comments
 (0)