Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide "funding" messages when running composer commands?

When using Composer, sometimes messages are displayed after installing or updating:

X packages you are using are looking for funding.
Use the `composer fund` command to find out more!

I want to know if there's a solution similar to this answer for npm, but for Composer.

Is there a way to hide the messages about projects needing funding? I checked the output of composer --help and didn't see any obvious flags.

like image 260
mbomb007 Avatar asked Sep 03 '20 21:09

mbomb007


People also ask

What is composer fund command?

The composer update command now outputs the number of packages you are using which are looking for funding and asks you to run the command for more details.

What does composer Phar do?

It is a PHAR (PHP archive), which is an archive format for PHP which can be run on the command line, amongst other things. Now run php composer.phar in order to run Composer.

What does composer require command do?

The require command adds new packages to the composer. json file from the current directory. If no file exists one will be created on the fly. After adding/changing the requirements, the modified requirements will be installed or updated.


1 Answers

There is no specific flag to target those two lines.

You can always use --quiet to get rid of all output, and have a completely silent run.

If for some reason you are particularly bothered by those two lines, but do not want to lose the rest of the output, you could always pipe stderr through grep and exclude those lines:

 composer update 2> >(grep -v "composer fund" | grep -v "looking for funding")

Which results in:

composer php output, without the "funding" lines

Notice in the screenshot above the conspicuous lack of any reference to funding.

If all this is worth doing or not, I'll leave up to you.

like image 55
yivi Avatar answered Nov 01 '22 07:11

yivi