1

As the title suggests, I would like to know if there is an option that I can use to force "yes" when a prompts appears after launching a command with yarn run or nx run.

Example:

yarn run nx run command nx run command

Prompts:

Port 4200 is already is use. Would you like to use a different port? (Y/n)

I would like the answer to this question to always be yes.

Thank you!

P.s: I use nx to manage a monorepo of angular. My operating system is currently windows and my editor is VS Code.

Edit: With echo Y | yarn run command everything works fine. Thanks to @aschipfl 's comment!

Elidor00
  • 1,271
  • 13
  • 27
  • 1
    Depending on the executable, you may pipe something into the prompt, given that it reads from _STDIN_ (handle `0`): `echo Y| yarn …`… – aschipfl Jan 26 '22 at 10:56
  • OMG it works! I kept typing `echo 'yes'` as if I were in a linux terminal and it didn't work. Thanks! – Elidor00 Jan 27 '22 at 09:17

0 Answers0