Skip to content

Commit

Permalink
wp-now: Compile and execute blueprint steps
Browse files Browse the repository at this point in the history
  • Loading branch information
sejas committed Jun 19, 2023
1 parent 3d2b4a6 commit 6602715
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/wp-now/src/wp-now.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import {
downloadWordPress,
} from './download';
import {
StepDefinition,
activatePlugin,
activateTheme,
compileBlueprint,
defineWpConfigConsts,
login,
runBlueprintSteps,
} from '@wp-playground/blueprints';
import { WPNowOptions, WPNowMode } from './config';
import {
Expand Down Expand Up @@ -132,6 +135,19 @@ export default async function startWPNow(
await activatePluginOrTheme(php, options);
}

if (options.blueprintObject) {
output.log(`blueprint steps: ${options.blueprintObject.steps.length}`);
const compiled = compileBlueprint(options.blueprintObject, {
onStepCompleted: (result, step: StepDefinition) => {
output.log(`Blueprint Step completed: ${step.step}`, {
result,
step,
});
},
});
await runBlueprintSteps(compiled, php);
}

return {
php,
phpInstances,
Expand Down

0 comments on commit 6602715

Please sign in to comment.