In tasks/core.yml we do shell: "ls {{ item.path }} | grep -q 'wp-'" to check if we need to do wp-cli core download.
When using this role for local development using Vagrant, and mounting a synced folder with the theme, there is a wp-content folder in the www root before this tasks run. Therefore it will think that it doesn't need to download the core, so it will skip the "download" task and then fail on the "configure" task.
Proposal: Instead of doing the ls | grep -q 'wp-' trick, I propose we do the same as the wp-cli does.
In tasks/core.yml we do
shell: "ls {{ item.path }} | grep -q 'wp-'"
to check if we need to do wp-cli core download.When using this role for local development using Vagrant, and mounting a synced folder with the theme, there is a wp-content folder in the www root before this tasks run. Therefore it will think that it doesn't need to download the core, so it will skip the "download" task and then fail on the "configure" task.
Proposal: Instead of doing the
ls | grep -q 'wp-'
trick, I propose we do the same as the wp-cli does.$wordpress_present = is_readable( $download_dir . 'wp-load.php' );
See: https://github.com/wp-cli/wp-cli/blob/master/php/commands/core.php#L115
I think this would do the trick:
shell: "[ -f {{ item.path }}/wp-load.php ];"