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

Feature: Support shell test contexts (e.g. bats-core) #19

Open
taqtiqa-mark opened this issue Jun 13, 2022 · 2 comments
Open

Feature: Support shell test contexts (e.g. bats-core) #19

taqtiqa-mark opened this issue Jun 13, 2022 · 2 comments

Comments

@taqtiqa-mark
Copy link

Thanks for all your effort in making enquirer, and for making it open source.

We've struggled to test a bash script that uses enquirer.
Our test framework is bats-core.

There may be other issues in that context.
However, we believe an initial stumbling block is that neither of the following work:

enquirer input --message "Project parent folder?" --default "$(pwd)" <<</tmp
enquirer input --message "Project parent folder?" --default "$(pwd)" < <(echo /tmp)

This looks like enquirer recognized an input device:

$ enquirer input --default "$(pwd)" --message "Project parent folder?" <(echo /tmp)
error: Found argument '/dev/fd/63' which wasn't expected, or isn't valid in this context

USAGE:
    enquirer input [OPTIONS] --message <MESSAGE>

For more information try --help

Appreciate any hints or tips.

@taqtiqa-mark taqtiqa-mark changed the title Feature: Shell test suppport Feature: Support shell test contexts (e.g. bats-core) Jun 13, 2022
@pksunkara
Copy link
Member

Are you trying to input stuff into enquirer?

The main use case of enquirer is for terminal based interactions. I don't think we allow reading those interactions from files. This is an underlying issue in https://github.com/mitsuhiko/dialoguer.

@taqtiqa-mark
Copy link
Author

taqtiqa-mark commented Jun 23, 2022

Are you trying to input stuff into enquirer?

Correct. This arose in testing scripts that use enquirer. It does look like enquirer would need to support io via pipes and heredocs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants