6

I am using Composer "composer update" via a cronjob to daily update an instance of software and thus run on master. About once a month this fails because Composer returns the following prompt:

The package has modified files

M modifiedfile.php

Discard changes [y,n,v,s,?]?

So no update is performed. This is a bit annoying. Is there a way to force the update even with modified files? Documentation at Composer suggests that this is not possible though I cannot believe that it should not.

So I am trying my luck here: Is there something like "composer update --force" or some sort of trick around or am I looking at a lost cause?

2 Answers 2

4

You can use --no-interaction for this.

https://getcomposer.org/doc/03-cli.md#composer-no-interaction

(old topic, but pops-up in Google without an answer)

1
0

--no-interaction answers N to this question - meaning that the composer install command fails.

There is no option which might answer Y or --force the install.

The only workaround seems to be rm -R /vendor/ before running composer install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.