@42wp/dev-env 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/start.js +15 -3
package/package.json
CHANGED
package/src/commands/start.js
CHANGED
|
@@ -217,12 +217,24 @@ export async function start(rawName, opts = {}) {
|
|
|
217
217
|
step(t('start.upping'));
|
|
218
218
|
await compose(['up', '-d', '--build'], { cwd: envDir });
|
|
219
219
|
|
|
220
|
-
// 6. Wait for
|
|
220
|
+
// 6. Wait for the WordPress core to be fully copied into the container before
|
|
221
|
+
// installing. The wordpress image's entrypoint extracts core alphabetically,
|
|
222
|
+
// so wp-includes/version.php lands BEFORE wp-settings.php — polling `wp core
|
|
223
|
+
// version` alone can proceed mid-copy on slow disks (e.g. a VM), and then
|
|
224
|
+
// `wp core install` fatals on a missing wp-settings.php. Waiting for
|
|
225
|
+
// wp-settings.php (which `install` requires, and which comes after all of
|
|
226
|
+
// wp-includes/) closes that window.
|
|
221
227
|
step(t('start.waitingWp'));
|
|
222
228
|
await pollUntil(
|
|
223
229
|
async () => {
|
|
224
|
-
const
|
|
225
|
-
|
|
230
|
+
const settings = await dockerExecCapture(container, [
|
|
231
|
+
'test',
|
|
232
|
+
'-f',
|
|
233
|
+
'/var/www/html/wp-settings.php',
|
|
234
|
+
]);
|
|
235
|
+
if (settings.code !== 0) return false;
|
|
236
|
+
const version = await dockerExecCapture(container, ['wp', 'core', 'version', '--allow-root']);
|
|
237
|
+
return version.code === 0;
|
|
226
238
|
},
|
|
227
239
|
{ label: 'WordPress', timeout: 90000 },
|
|
228
240
|
);
|