Skip to content

Link to website on mac #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2021
Merged
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
12 changes: 11 additions & 1 deletion src/Factory/MenuFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace PhpSchool\PhpWorkshop\Factory;

use PhpSchool\CliMenu\Action\ExitAction;
use PhpSchool\CliMenu\MenuItem\SelectableItem;
use PhpSchool\CliMenu\Style\SelectableStyle;
use PhpSchool\Terminal\Terminal;
use Psr\Container\ContainerInterface;
Expand Down Expand Up @@ -74,7 +76,7 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) {
->addLineBreak()
->addItem('HELP', new MenuCommandInvoker($c->get(HelpCommand::class)))
->addItem('CREDITS', new MenuCommandInvoker($c->get(CreditsCommand::class)))
->setExitButtonText('EXIT')
->disableDefaultItems()
->setBackgroundColour($c->get('bgColour'))
->setForegroundColour($c->get('fgColour'))
->setMarginAuto()
Expand Down Expand Up @@ -110,6 +112,14 @@ function (CliMenu $menu) use ($exerciseRenderer, $eventDispatcher, $exercise) {
})
->addLineBreak();

$builder->addMenuItem(new SelectableItem('EXIT', new ExitAction()));

if (PHP_OS_FAMILY === 'Darwin') {
$builder->addLineBreak();
$builder->addItem('www.phpschool.io', function () {
exec('open https://www.phpschool.io');
});
}

if (null !== $c->get('workshopTitle')) {
$builder->setTitle($c->get('workshopTitle'));
Expand Down