Skip to content

Commit

Permalink
Add episode 5
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Apr 15, 2021
1 parent d2ca83d commit b2464a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions episode-5/deploy/my-first-recipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@
writeln("Your secret ingredient is safe with me.");
});

desc('Demo prompting with options.');
task('app:option', function () {
$force = input()->getOption('force', false);
$fruit = $force ? 'strawberry' : ask("What's your favourite fruit?", 'strawberry');
set('should_prompt', true);

desc('Demo bypassing prompts.');
task('app:bypass:prompt', function () {
$shouldPrompt = get('should_prompt', true);
$fruit = $shouldPrompt ? ask("What's your favourite fruit?", 'strawberry') : 'strawberry';
writeln("You're favourite fruit is: $fruit");
});

0 comments on commit b2464a7

Please sign in to comment.