jayhill90 / genesis-generator

WordPress plugin to generate a child theme based on the Genesis Sample theme via WP-CLI
20 stars 0 forks source link

If slug folder exists, confirm removal rather than error out #13

Closed jayhill90 closed 5 years ago

jayhill90 commented 5 years ago

Right now if we try to make a theme with the slug of a theme that exists we error out and have to manually remove the directory.

PHP Warning:  rename(/wordpress/wp-content/themes/genesis-sample-master,/wordpress/wp-content/themes/my-theme3): Directory not empty in /wordpress/wp-content/plugins/genesis-generator/inc/class-zipper.php on line 22
Warning: rename(/wordpress/wp-content/themes/genesis-sample-master,/wordpress/wp-content/themes/my-theme3): Directory not empty in /wordpress/wp-content/plugins/genesis-generator/inc/class-zipper.php on line 22
Error: Failed to rename temp directory

We want to prompt overwriting/removing of the directory first.

jayhill90 commented 5 years ago

Since we don't want to overwrite themes that already exist let's just have this error if it does exist. Got a commit for that now.