Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force composer to automatically ignore warrning?

I'm making shell script which will install symfony 4 on ubuntu automatically. Since I'm using apache I have to execute:

composer require symfony/apache-pack

However, that command asks me to confirm:

composer require symfony/apache-pack

The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack/1.0

Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): y

And I can't use --no-interaction options since default value is "n". How can I change this command not to ask me to confirm this action, but to automatically installs this apache pack?

like image 353
MilanG Avatar asked Dec 23 '22 00:12

MilanG


1 Answers

This does not answer the question per se, but you can get rid of your specific warning per project if you add the following to your composer.json:

"extra": {
    "symfony": {
        "allow-contrib": true
    }
}

or, even better, you can use Composer itself to set the flag before installing symfony/apache-pack:

composer config extra.symfony.allow-contrib true

This will make possible for Flex to install contrib recipes (i.e. recipes provided by the community) automatically, without asking for permission.

like image 109
Edi Modrić Avatar answered Dec 26 '22 06:12

Edi Modrić