Closed batopa closed 7 years ago
Two firings of the post-update-cmd
event on initial install is expected behavior. Composer-merge-plugin detects when it is initially installed and triggers a installer run. This is done so that the end state of the vendor directory reflects the composer-merge-plugin configuration for the deployment. If we did not do this, composer-merge-plugin would only be effective on a second manual run of composer install
or composer update
.
@bd808, do those 2 firings also apply for post-install-cmd? I'm trying to figure out why all of the scripts in the composer scripts
section are executed twice. This does not seem logical to be an expected behavior.
do those 2 firings also apply for post-install-cmd?
It can happen for either update and install. The condition that causes this is the installation of the composer-merge-plugin library itself into the vendor repo and subsequent initialization by Composer. When composer-merge-plugin thinks that it has been installed for the first time it will cause a second install/update run of Composer so that it can have a chance to modify the dependency information that Composer uses to determine which packages to install. This "double run" should only happen when the plugin is first added to vendor.
In my
scripts
section ofcomposer.json
I hook two scripts to execute on first installation and on next updates.Before using
composer-merge-plugin
the script run one time on firstcomposer install
(no composer.lock present) and one time on nextcomposer update
command.After required
composer-merge-plugin
I have an issue on first install (no composer.lock present). The script inpost-update-cmd
is executed two times but from composer doc it appears a wrong behavior:Here the console output
Another strange behavior is that after the first question (
Set Folder Permissions ? (Default to Y) [Y,n]?
) the process go ahead without waiting the answer while the secont time it stops rightly.On next
composer update
command all seems right.