From b2464a759dcaf151f71356e4023df1b45b4b3ee0 Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Thu, 15 Apr 2021 20:21:23 +0100 Subject: [PATCH] Add episode 5 --- episode-5/deploy/my-first-recipe.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/episode-5/deploy/my-first-recipe.php b/episode-5/deploy/my-first-recipe.php index 281c3f7..17dc626 100644 --- a/episode-5/deploy/my-first-recipe.php +++ b/episode-5/deploy/my-first-recipe.php @@ -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"); });