johnpbloch / wordpress-core-installer

A composer installer for WordPress core so I can stop saying core is a wordpress-plugin type package.
https://packagist.org/packages/johnpbloch/wordpress-core-installer
GNU General Public License v2.0
207 stars 48 forks source link

Only install if directory doesn't exist or is empty #19

Closed georgehanson closed 6 years ago

georgehanson commented 6 years ago

Is it possible to only have it install wordpress if the directory it is trying to install to either doesn't exist or is empty?

For example, we had an issue with one of the packages in our vendor folder and ended up removing the vendor folder. Then upon doing a composer install, it removed the current wordpress installation we had, along with custom themes, plugins etc.

Thanks

tomjn commented 6 years ago

You can't do a root WP install with composer, it has to be a sub directory install. This is because composer doesn't do nested packages, and it updates a package by deleting it and installing the newer version in its place.

Implementing this request would make it impossible to update WP via Composer

johnpbloch commented 6 years ago

The other problem beyond root installations being unsupported that I see with this proposal is that if the installer won't allow using non-empty directories, it prevents composer from ever updating core. If you're not using composer to update your packages, then what's the point of using composer at all? Downloading a package and unpacking it is the least valuable part of what composer does.