Skip to content
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

[10.x] Set prompt interactivity mode #48468

Merged
merged 9 commits into from
Sep 26, 2023
Merged

Conversation

jessarcher
Copy link
Member

This PR adds support for Prompts in non-interactive mode, introduced in laravel/prompts#73.

Previously, Laravel would rely on the Prompts fallback behaviour (using Symfony) to handle commands that use the -n argument to make them non-interactive, which is unrelated to whether STDIN is a tty. This did not handle scenarios like CI, scheduled tasks, queued jobs, etc.

A simpler solution would have been to enable the fallbacks when STDIN is not a TTY. However, I found Symfony's non-interactive behaviour a little unexpected. This feature also unlocks the ability for Prompts to provide default fallbacks (laravel/prompts#57) which removes the need for specifying them in the Laravel installer and other places where Laravel doesn't provide defaults.

@jessarcher
Copy link
Member Author

jessarcher commented Sep 20, 2023

The build will fail until laravel/prompts#73 is tagged as 0.1.9.

crynobone added a commit to laravel/prompts that referenced this pull request Sep 22, 2023
* Require Laravel Framework 10.25+ : laravel/framework#48468
* Alias `dev-main` to `0.1.x-dev`
@jessarcher jessarcher marked this pull request as ready for review September 22, 2023 04:32
@driesvints driesvints marked this pull request as draft September 22, 2023 07:05
taylorotwell pushed a commit to laravel/prompts that referenced this pull request Sep 22, 2023
* Update dependencies for 0.1.9 release

* Require Laravel Framework 10.25+ : laravel/framework#48468
* Alias `dev-main` to `0.1.x-dev`

* wip

* wip
crynobone and others added 9 commits September 26, 2023 22:30
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone marked this pull request as ready for review September 26, 2023 15:15
@taylorotwell taylorotwell merged commit 5132daf into 10.x Sep 26, 2023
21 checks passed
@taylorotwell taylorotwell deleted the non-interactive-prompts branch September 26, 2023 15:22
duncanmcclean added a commit to statamic/cms that referenced this pull request Mar 15, 2024
When running the test suite on Laravel 10.0.0, Prompts would show me the interactive prompt, meaning the assertions wouldn't take place.

Related: laravel/framework#48468
duncanmcclean added a commit to statamic/cms that referenced this pull request Mar 15, 2024
When running the test suite on Laravel 10.0.0, Prompts would show me the interactive prompt, meaning the assertions wouldn't take place.

Related: laravel/framework#48468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants