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

npm create astro --yes should skip all questions #8543

Closed
1 task
totalhack opened this issue Sep 13, 2023 · 5 comments
Closed
1 task

npm create astro --yes should skip all questions #8543

totalhack opened this issue Sep 13, 2023 · 5 comments
Labels
needs discussion Issue needs to be discussed

Comments

@totalhack
Copy link

Astro Info

N/A, this happens during install using the `npm create astro` helper. It's the "v3.0.13 launch sequence."

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The --yes option doesn't seem to skip all questions as the help string suggests. You can get by this by specifying a template but I believe --yes should use the recommended template and not prompt the user. As a new user it's unclear to me what templates would be equivalent to the options below (perhaps the template name should be in that output?).

$ npm create astro newdir -- --skip-houston --yes

 astro   v3.0.13 Launch sequence initiated.

      ◼  dir Using newdir as project directory

  tmpl   How would you like to start your new project?
         ● Include sample files (recommended)
         ○ Use blog template 
         ○ Empty 
create-astro [dir] [...flags]

             --help (-h)  See all available flags.
       --template <name>  Specify your template.
--install / --no-install  Install dependencies (or not).
        --git / --no-git  Initialize git repo (or not).
              --yes (-y)  Skip all prompt by accepting defaults.
               --no (-n)  Skip all prompt by declining defaults.
               --dry-run  Walk through steps without executing.
          --skip-houston  Skip Houston animation.
                   --ref  Choose astro branch (default: latest).
                 --fancy  Enable full unicode support for Windows.
   --typescript <option>  TypeScript option: strict | strictest | relaxed.

What's the expected result?

Astro gets setup with the recommended starter defaults.

Link to Minimal Reproducible Example

N/A

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 13, 2023
@jacobdalamb
Copy link
Contributor

Looking at the code, --yes does behave as expected.

@totalhack
Copy link
Author

So to be clear, you expect that --yes will still ask you to confirm a template if you haven't specified one on the command line? That seems like it falls short of how similar flags are used by other tools.

@jacobdalamb
Copy link
Contributor

I guess since it displays Include sample files (recommended), it should choose that option when running --yes

@lilnasy
Copy link
Contributor

lilnasy commented Sep 14, 2023

--yes is working as intended, all the yes-or-no questions are skipped. The part that doesn't get skipped is template selection, which is not a yes or no question. You can explicitly add a template to skip that part as well, for example --template blog.

@lilnasy lilnasy added needs discussion Issue needs to be discussed and removed needs triage Issue needs to be triaged labels Sep 14, 2023
@jacobdalamb
Copy link
Contributor

This issue can be closed. PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Issue needs to be discussed
Projects
None yet
Development

No branches or pull requests

4 participants