playground-tools icon indicating copy to clipboard operation
playground-tools copied to clipboard

wp-now: repeated blueprint executions will faill

Open lgersman opened this issue 1 year ago • 2 comments

If i repeatedly start wp-now installing a default theme will result in an error:

```
{
	"step": "mkdir",
	"path": "/var/www/html/wp-content/themes"
},
{
	"step": "installTheme",
	"themeZipFile": {
		"resource": "wordpress.org/themes",
		"slug": "twentytwentyfour"
	},
	"options": {
		"activate": true
	}
}

```
Failed to start the server: Error when executing the blueprint step #1 installTheme({"step":"installTheme","themeZipFile":{"resource":"wordpress.org/themes","slug":"twentytwentyfour"},"options":{"activate":true}}) : Could not move /var/www/html/wp-content/mjEznHQBp+eN]u2u(C=<+NjPv4RkH7ystyI-/assets/Twentytwentyfour/twentytwentyfour to /var/www/html/wp-content/themes/twentytwentyfour: Directory not empty.

Both steps will fail when called repeatedly.

mkdir will fail the second time because the path already exists.

installTheme will fail the second time because the theme is already installed.

I suppose there should be an options to make such steps fail gracefully instead of aborting the whole blueprint process.

lgersman avatar Jun 15 '24 07:06 lgersman

@lgersman , have you tried running with --reset flag? Would that fix your issue?

sejas avatar Jun 26 '24 12:06 sejas

Hi @sejas,

Yes, tried the --reset option too, but it doesn't changed the final outcome (an error because the directory was already existing).

BTW: Wouldn't it be neat to have a mkdir step option to gracefully continue if the directory is already existing ?

lgersman avatar Jun 29 '24 06:06 lgersman