Collapse install output with task() - #110
Open
duncanmcclean wants to merge 3 commits into
Open
Conversation
Wrap the composer create-project and git init steps in RunsCommands with a Laravel Prompts task(), collapsing the raw scrolling output into a spinner that finishes as a single checkmark line, matching what the Laravel installer now does. Falls back to the existing raw output when task()/pcntl_fork aren't available or output isn't decorated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request integrates the
task()helper fromlaravel/promptsinto the install process, similar to what the Laravel installer has started doing.The
composer create-projectstep and git init step currently dump their raw, scrolling command output straight to the terminal. This PR wraps them in atask()instead, which collapses the output into a spinner with a live-updating log, finishing as a single✔ Installing Statamic/✔ Initializing Git repositoryline on success.This only kicks in when
task()andpcntl_forkare available and output is decorated at normal verbosity — otherwiseRunsCommandsfalls back to the existing raw scrolling output, so behaviour is unchanged for--no-ansi,-v, and non-interactive/non-decorated environments.