3

Every time I use a command on the Elastic Beanstalk CLI like eb init or eb deploy it prompts me with:

Do you wish to continue with CodeCommit? (y/N) (default is n):

And I always say 'no'.

Is there a way to suppress this prompt or provide a default answer?

I have checked the EB CLI documentation but I haven't been able to find anything.

richflow
  • 1,902
  • 3
  • 14
  • 21

2 Answers2

1

If you're using this command programatically, you can pass a negative response to the eb init or eb deploy with a Unix command called yes - the name seems to contradict what you're trying to achieve, but it can be used to pass a user-definied string instead of the default affirmative response. Usage:

yes n | eb deploy

It will behave as if you pressed the 'n' key. Keep in mind that 'n' will be looped (it will be an answer to all the prompts during the command execution).

Another option is using printf:

printf '\n\n\n\n' | eb deploy

This would behave as if you pressed the Enter key 4 times (4 prompts).

There are some more alternatives and usage examples in this question.

arudzinska
  • 3,152
  • 1
  • 16
  • 29
  • thanks, I didn't know about the 'yes' command. But I was hoping for a more robust solution as I use it in scripts as well as manually. – richflow Dec 12 '18 at 10:47
1

If you want to suppress all prompts from eb init, pass the --platform PLATFORM_NAME argument. A complete command might look like:

eb init APPLICATION_NAME \
    --region REGION_NAME \
    --platform PLATFORM_NAME
progfan
  • 2,454
  • 3
  • 22
  • 28