Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow target directory to exist if it is empty #112

Open

Conversation

@SteenSchutt
Copy link

SteenSchutt commented Oct 22, 2019

Alter the site existence check for the site:create command to allow the
target directory to exist as long as it is empty.

This is useful when the user is manually managing their virtual hosts,
as they won't have to delete their webroot directory when using
--use-webroot-dir.

The count has to be above 2 because scandir includes . and ...
Another, more verbose, way to go about it would be
count(array_diff(scandir($this->target_directory), ['.', '..'])) > 0)
Feel free to change it if you prefer that approach.

Alter the site existence check for the site:create command to allow the
target directory to exist as long as it is empty.

This is useful when the user is manually managing their virtual hosts,
as they won't have to delete their webroot directory when using
--use-webroot-dir.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.