Closed malthejorgensen closed 7 years ago
Composer updates a package by deleting it then installing the latest version. If your package is located in the root directory then the root directory is deleted and replaced with the latest version. This is expected behaviour in composer, which doesn't support nested packages, and would normally have dependencies in a vendor
sub folder, so the chances of this being changed in composer are next to zero. There's little that can be done about it from this installer package.
I would advise you take one of the following steps:
I've gotten a lot of benefit from using the latter method when needing WordPress installed in the root, and managing everything else from composer, especially combined with the scripts configuration in composer.json
Fixed in v1.0.0
I have this issue as well. While the WP-CLI suggestion is a good one, I think I may have found a way to still do everything in Composer using drupal-composer/preserve-paths. It's not perfect, but it works (and it could be even more so if my feature request over there is accepted).
I wanted to install Wordpress in the same folder as the rest of my files so I set
in
composer.json
.This erased all files in the directory, including the
.git
-folder and.gitignore
– leaving only the files from this repository (johnpbloch/wordpress).Moved from johnpbloch/wordpress issue #23