Skip to content

Commit

Permalink
Fix jolinotif executable in verbose mode when no driver is available
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrech committed May 3, 2024
1 parent 0b525e2 commit 27b0f29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Not released yet

* Fixed jolinotif executable in verbose mode when no driver is available

## 2.7.0 (2024-05-03)

* Added a new NotifierInterface and DefaultNotifier as the main public API of this package
Expand Down
6 changes: 5 additions & 1 deletion jolinotif
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ $result = $notifier->send($notification);
$driver = $notifier->getDriver();

if ($cli->hasOption('verbose')) {
$cli->log(sprintf('Notification %s with %s. ', $result ? 'successfully sent' : 'failed', str_replace('Joli\\JoliNotif\\Driver\\', '', $driver::class)));
if (!$driver) {
$cli->log('No driver available to display a notification on your system.');
} else {
$cli->log(sprintf('Notification %s with %s. ', $result ? 'successfully sent' : 'failed', str_replace('Joli\\JoliNotif\\Driver\\', '', $driver::class)));
}
}

exit($result ? 0 : 1);

0 comments on commit 27b0f29

Please sign in to comment.